Package com.pulumi.aws.mediastore
Class ContainerPolicy
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.mediastore.ContainerPolicy
-
public class ContainerPolicy extends com.pulumi.resources.CustomResourceProvides a MediaStore Container Policy. > **WARNING:** _This resource is deprecated and will be removed in a future version._ AWS has [announced](https://aws.amazon.com/blogs/media/support-for-aws-elemental-mediastore-ending-soon/) the discontinuation of AWS Elemental MediaStore, effective **November 13, 2025**. Users should begin transitioning to alternative solutions as soon as possible. For **simple live streaming workflows**, AWS recommends migrating to **Amazon S3**. For **advanced use cases** that require features such as packaging, DRM, or cross-region redundancy, consider using **AWS Elemental MediaPackage**. > **NOTE:** We suggest using `jsonencode()` or `aws.iam.getPolicyDocument` when assigning a value to `policy`. They seamlessly translate Terraform language into JSON, enabling you to maintain consistency within your configuration without the need for context switches. Also, you can sidestep potential complications arising from formatting discrepancies, whitespace inconsistencies, and other nuances inherent to JSON. ## Example Usage
## Import Using `pulumi import`, import MediaStore Container Policy using the MediaStore Container Name. For example: ```sh $ pulumi import aws:mediastore/containerPolicy:ContainerPolicy example example ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.AwsFunctions; import com.pulumi.aws.inputs.GetRegionArgs; import com.pulumi.aws.inputs.GetCallerIdentityArgs; import com.pulumi.aws.mediastore.Container; import com.pulumi.aws.mediastore.ContainerArgs; 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.GetPolicyDocumentStatementConditionArgs; import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementPrincipalArgs; import com.pulumi.aws.mediastore.ContainerPolicy; import com.pulumi.aws.mediastore.ContainerPolicyArgs; 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) { final var current = AwsFunctions.getRegion(GetRegionArgs.builder() .build()); final var currentGetCallerIdentity = AwsFunctions.getCallerIdentity(GetCallerIdentityArgs.builder() .build()); var exampleContainer = new Container("exampleContainer", ContainerArgs.builder() .name("example") .build()); final var example = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder() .statements(GetPolicyDocumentStatementArgs.builder() .conditions(GetPolicyDocumentStatementConditionArgs.builder() .test("Bool") .variable("aws:SecureTransport") .values("true") .build()) .principals(GetPolicyDocumentStatementPrincipalArgs.builder() .type("AWS") .identifiers(String.format("arn:aws:iam::%s:root", currentGetCallerIdentity.accountId())) .build()) .sid("MediaStoreFullAccess") .effect("Allow") .actions("mediastore:*") .resources(exampleContainer.name().applyValue(_name -> String.format("arn:aws:mediastore:%s:%s:container/%s/*", current.region(),currentGetCallerIdentity.accountId(),_name))) .build()) .build()); var exampleContainerPolicy = new ContainerPolicy("exampleContainerPolicy", ContainerPolicyArgs.builder() .containerName(exampleContainer.name()) .policy(example.applyValue(_example -> _example.json())) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description ContainerPolicy(java.lang.String name)ContainerPolicy(java.lang.String name, ContainerPolicyArgs args)ContainerPolicy(java.lang.String name, ContainerPolicyArgs 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.lang.String>containerName()static ContainerPolicyget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ContainerPolicyState 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()
-
-
-
Constructor Detail
-
ContainerPolicy
public ContainerPolicy(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
ContainerPolicy
public ContainerPolicy(java.lang.String name, ContainerPolicyArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
ContainerPolicy
public ContainerPolicy(java.lang.String name, ContainerPolicyArgs 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
-
containerName
public com.pulumi.core.Output<java.lang.String> containerName()
- Returns:
- Name of the container.
-
policy
public com.pulumi.core.Output<java.lang.String> policy()
- Returns:
- Contents of the policy. For more information about building AWS IAM policy documents with Terraform, see the AWS IAM Policy Document Guide.
-
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 ContainerPolicy get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ContainerPolicyState 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.
-
-