Package com.pulumi.aws.xray
Class ResourcePolicy
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.xray.ResourcePolicy
-
public class ResourcePolicy extends com.pulumi.resources.CustomResourceResource for managing an AWS X-Ray Resource Policy. ## Example Usage ### Basic Usage
## Import ### Identity Schema #### Required * `policyName` (String) Resource policy name. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import X-Ray Resource Policies using `policyName`. For example: ```sh $ pulumi import aws:xray/resourcePolicy:ResourcePolicy example example-policy ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.xray.ResourcePolicy; import com.pulumi.aws.xray.ResourcePolicyArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var test = new ResourcePolicy("test", ResourcePolicyArgs.builder() .policyName("test") .policyDocument("{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AllowXRayAccess\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Action\":[\"xray:*\",\"xray:PutResourcePolicy\"],\"Resource\":\"*\"}]}") .bypassPolicyLockoutCheck(true) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description ResourcePolicy(java.lang.String name)ResourcePolicy(java.lang.String name, ResourcePolicyArgs args)ResourcePolicy(java.lang.String name, ResourcePolicyArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>bypassPolicyLockoutCheck()static ResourcePolicyget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ResourcePolicyState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>lastUpdatedTime()com.pulumi.core.Output<java.lang.String>policyDocument()com.pulumi.core.Output<java.lang.String>policyName()com.pulumi.core.Output<java.lang.String>policyRevisionId()com.pulumi.core.Output<java.lang.String>region()
-
-
-
Constructor Detail
-
ResourcePolicy
public ResourcePolicy(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
ResourcePolicy
public ResourcePolicy(java.lang.String name, ResourcePolicyArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
ResourcePolicy
public ResourcePolicy(java.lang.String name, ResourcePolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
bypassPolicyLockoutCheck
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> bypassPolicyLockoutCheck()
- Returns:
- Whether to bypass the resource policy lockout safety check. Setting this value to true increases the risk that the policy becomes unmanageable. Do not set this value to true indiscriminately. Use this parameter only when you include a policy in the request and you intend to prevent the principal that is making the request from making a subsequent PutResourcePolicy request. The default value is `false`.
-
lastUpdatedTime
public com.pulumi.core.Output<java.lang.String> lastUpdatedTime()
- Returns:
- When the policy was last updated, in Unix time seconds.
-
policyDocument
public com.pulumi.core.Output<java.lang.String> policyDocument()
- Returns:
- JSON string of the resource policy or resource policy document, which can be up to 5kb in size.
-
policyName
public com.pulumi.core.Output<java.lang.String> policyName()
- Returns:
- Name of the resource policy. Must be unique within a specific Amazon Web Services account. The following arguments are optional:
-
policyRevisionId
public com.pulumi.core.Output<java.lang.String> policyRevisionId()
- Returns:
- Specific policy revision, to ensure an atomic create operation. By default the resource policy is created if it does not exist, or updated with an incremented revision ID. The revision ID is unique to each policy in the account. If the policy revision ID does not match the latest revision ID, the operation will fail with an InvalidPolicyRevisionIdException exception. You can also provide a PolicyRevisionId of 0. In this case, the operation will fail with an InvalidPolicyRevisionIdException exception if a resource policy with the same name already exists.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
get
public static ResourcePolicy get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ResourcePolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-