Package com.pulumi.aws.pinpoint
Class Smsvoicev2ResourcePolicy
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.pinpoint.Smsvoicev2ResourcePolicy
-
public class Smsvoicev2ResourcePolicy extends com.pulumi.resources.CustomResourceManages an AWS End User Messaging SMS Resource Policy. ## Example Usage ### Basic Usage
## Import ### Identity Schema #### Required * `resourceArn` (String) ARN of the End User Messaging SMS resource the policy is attached to. Using `pulumi import`, import the resource policy using the parent resource ARN. For example: ```sh $ pulumi import aws:pinpoint/smsvoicev2ResourcePolicy:Smsvoicev2ResourcePolicy example arn:aws:sms-voice:us-east-1:123456789012:phone-number/phone-abcdef0123456789abcdef0123456789 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.pinpoint.Smsvoicev2PhoneNumber; import com.pulumi.aws.pinpoint.Smsvoicev2PhoneNumberArgs; import com.pulumi.aws.iam.IamFunctions; import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs; import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementArgs; import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementPrincipalArgs; import com.pulumi.aws.pinpoint.Smsvoicev2ResourcePolicy; import com.pulumi.aws.pinpoint.Smsvoicev2ResourcePolicyArgs; 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 exampleSmsvoicev2PhoneNumber = new Smsvoicev2PhoneNumber("exampleSmsvoicev2PhoneNumber", Smsvoicev2PhoneNumberArgs.builder() .isoCountryCode("US") .messageType("TRANSACTIONAL") .numberType("SIMULATOR") .numberCapabilities("SMS") .build()); final var example = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder() .statements(GetPolicyDocumentStatementArgs.builder() .principals(GetPolicyDocumentStatementPrincipalArgs.builder() .type("AWS") .identifiers("123456789012") .build()) .effect("Allow") .actions("sms-voice:SendTextMessage") .resources(exampleSmsvoicev2PhoneNumber.arn()) .build()) .build()); var exampleSmsvoicev2ResourcePolicy = new Smsvoicev2ResourcePolicy("exampleSmsvoicev2ResourcePolicy", Smsvoicev2ResourcePolicyArgs.builder() .resourceArn(exampleSmsvoicev2PhoneNumber.arn()) .policy(example.applyValue(_example -> _example.json())) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description Smsvoicev2ResourcePolicy(java.lang.String name)Smsvoicev2ResourcePolicy(java.lang.String name, Smsvoicev2ResourcePolicyArgs args)Smsvoicev2ResourcePolicy(java.lang.String name, Smsvoicev2ResourcePolicyArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Smsvoicev2ResourcePolicyget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, Smsvoicev2ResourcePolicyState 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>policy()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.String>resourceArn()
-
-
-
Constructor Detail
-
Smsvoicev2ResourcePolicy
public Smsvoicev2ResourcePolicy(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
Smsvoicev2ResourcePolicy
public Smsvoicev2ResourcePolicy(java.lang.String name, Smsvoicev2ResourcePolicyArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
Smsvoicev2ResourcePolicy
public Smsvoicev2ResourcePolicy(java.lang.String name, Smsvoicev2ResourcePolicyArgs 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
-
policy
public com.pulumi.core.Output<java.lang.String> policy()
- Returns:
- Resource-based policy document in JSON format.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-region). Defaults to the region set in the provider configuration.
-
resourceArn
public com.pulumi.core.Output<java.lang.String> resourceArn()
- Returns:
- ARN of the End User Messaging SMS resource — phone number, opt-out list, pool, or sender ID — to attach the policy to. The following arguments are optional:
-
get
public static Smsvoicev2ResourcePolicy get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable Smsvoicev2ResourcePolicyState 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.
-
-