Package com.pulumi.aws.glacier
Class Vault
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.glacier.Vault
-
public class Vault extends com.pulumi.resources.CustomResource
Provides a Glacier Vault Resource. You can refer to the [Glacier Developer Guide](https://docs.aws.amazon.com/amazonglacier/latest/dev/working-with-vaults.html) for a full explanation of the Glacier Vault functionality > **NOTE:** When removing a Glacier Vault, the Vault must be empty. ## Example Usage <!--Start PulumiCodeChooser --> ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.sns.Topic; import com.pulumi.aws.sns.TopicArgs; import com.pulumi.aws.iam.IamFunctions; import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs; import com.pulumi.aws.glacier.Vault; import com.pulumi.aws.glacier.VaultArgs; import com.pulumi.aws.glacier.inputs.VaultNotificationArgs; import java.util.List; import java.util.ArrayList; 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 awsSnsTopic = new Topic("awsSnsTopic", TopicArgs.builder() .name("glacier-sns-topic") .build()); final var myArchive = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder() .statements(GetPolicyDocumentStatementArgs.builder() .sid("add-read-only-perm") .effect("Allow") .principals(GetPolicyDocumentStatementPrincipalArgs.builder() .type("*") .identifiers("*") .build()) .actions( "glacier:InitiateJob", "glacier:GetJobOutput") .resources("arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive") .build()) .build()); var myArchiveVault = new Vault("myArchiveVault", VaultArgs.builder() .name("MyArchive") .notification(VaultNotificationArgs.builder() .snsTopic(awsSnsTopic.arn()) .events( "ArchiveRetrievalCompleted", "InventoryRetrievalCompleted") .build()) .accessPolicy(myArchive.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json())) .tags(Map.of("Test", "MyArchive")) .build()); } } ``` <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import Glacier Vaults using the `name`. For example: ```sh $ pulumi import aws:glacier/vault:Vault archive my_archive ```
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<java.lang.String>>
accessPolicy()
com.pulumi.core.Output<java.lang.String>
arn()
static Vault
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, VaultState 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>
location()
com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.util.Optional<VaultNotification>>
notification()
com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>
tags()
com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>
tagsAll()
-
-
-
Constructor Detail
-
Vault
public Vault(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
Vault
public Vault(java.lang.String name, @Nullable VaultArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
Vault
public Vault(java.lang.String name, @Nullable VaultArgs 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
-
accessPolicy
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> accessPolicy()
- Returns:
- The policy document. This is a JSON formatted string. The heredoc syntax or `file` function is helpful here. Use the [Glacier Developer Guide](https://docs.aws.amazon.com/amazonglacier/latest/dev/vault-access-policy.html) for more information on Glacier Vault Policy
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- The ARN of the vault.
-
location
public com.pulumi.core.Output<java.lang.String> location()
- Returns:
- The URI of the vault that was created.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
-
notification
public com.pulumi.core.Output<java.util.Optional<VaultNotification>> notification()
- Returns:
- The notifications for the Vault. Fields documented below.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
-
get
public static Vault get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable VaultState 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.
-
-