Try AWS Native preview for resources not in the classic version.
aws.glacier.Vault
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides a Glacier Vault Resource. You can refer to the Glacier Developer Guide for a full explanation of the Glacier Vault functionality
NOTE: When removing a Glacier Vault, the Vault must be empty.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var awsSnsTopic = new Aws.Sns.Topic("awsSnsTopic");
var myArchivePolicyDocument = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Sid = "add-read-only-perm",
Effect = "Allow",
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Type = "*",
Identifiers = new[]
{
"*",
},
},
},
Actions = new[]
{
"glacier:InitiateJob",
"glacier:GetJobOutput",
},
Resources = new[]
{
"arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive",
},
},
},
});
var myArchiveVault = new Aws.Glacier.Vault("myArchiveVault", new()
{
Notification = new Aws.Glacier.Inputs.VaultNotificationArgs
{
SnsTopic = awsSnsTopic.Arn,
Events = new[]
{
"ArchiveRetrievalCompleted",
"InventoryRetrievalCompleted",
},
},
AccessPolicy = myArchivePolicyDocument.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
Tags =
{
{ "Test", "MyArchive" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glacier"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
awsSnsTopic, err := sns.NewTopic(ctx, "awsSnsTopic", nil)
if err != nil {
return err
}
myArchivePolicyDocument, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Sid: pulumi.StringRef("add-read-only-perm"),
Effect: pulumi.StringRef("Allow"),
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Type: "*",
Identifiers: []string{
"*",
},
},
},
Actions: []string{
"glacier:InitiateJob",
"glacier:GetJobOutput",
},
Resources: []string{
"arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = glacier.NewVault(ctx, "myArchiveVault", &glacier.VaultArgs{
Notification: &glacier.VaultNotificationArgs{
SnsTopic: awsSnsTopic.Arn,
Events: pulumi.StringArray{
pulumi.String("ArchiveRetrievalCompleted"),
pulumi.String("InventoryRetrievalCompleted"),
},
},
AccessPolicy: *pulumi.String(myArchivePolicyDocument.Json),
Tags: pulumi.StringMap{
"Test": pulumi.String("MyArchive"),
},
})
if err != nil {
return err
}
return nil
})
}
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.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");
final var myArchivePolicyDocument = 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()
.notification(VaultNotificationArgs.builder()
.snsTopic(awsSnsTopic.arn())
.events(
"ArchiveRetrievalCompleted",
"InventoryRetrievalCompleted")
.build())
.accessPolicy(myArchivePolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.tags(Map.of("Test", "MyArchive"))
.build());
}
}
import pulumi
import pulumi_aws as aws
aws_sns_topic = aws.sns.Topic("awsSnsTopic")
my_archive_policy_document = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
sid="add-read-only-perm",
effect="Allow",
principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
type="*",
identifiers=["*"],
)],
actions=[
"glacier:InitiateJob",
"glacier:GetJobOutput",
],
resources=["arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive"],
)])
my_archive_vault = aws.glacier.Vault("myArchiveVault",
notification=aws.glacier.VaultNotificationArgs(
sns_topic=aws_sns_topic.arn,
events=[
"ArchiveRetrievalCompleted",
"InventoryRetrievalCompleted",
],
),
access_policy=my_archive_policy_document.json,
tags={
"Test": "MyArchive",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const awsSnsTopic = new aws.sns.Topic("awsSnsTopic", {});
const myArchivePolicyDocument = aws.iam.getPolicyDocument({
statements: [{
sid: "add-read-only-perm",
effect: "Allow",
principals: [{
type: "*",
identifiers: ["*"],
}],
actions: [
"glacier:InitiateJob",
"glacier:GetJobOutput",
],
resources: ["arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive"],
}],
});
const myArchiveVault = new aws.glacier.Vault("myArchiveVault", {
notification: {
snsTopic: awsSnsTopic.arn,
events: [
"ArchiveRetrievalCompleted",
"InventoryRetrievalCompleted",
],
},
accessPolicy: myArchivePolicyDocument.then(myArchivePolicyDocument => myArchivePolicyDocument.json),
tags: {
Test: "MyArchive",
},
});
resources:
awsSnsTopic:
type: aws:sns:Topic
myArchiveVault:
type: aws:glacier:Vault
properties:
notification:
snsTopic: ${awsSnsTopic.arn}
events:
- ArchiveRetrievalCompleted
- InventoryRetrievalCompleted
accessPolicy: ${myArchivePolicyDocument.json}
tags:
Test: MyArchive
variables:
myArchivePolicyDocument:
fn::invoke:
Function: aws:iam:getPolicyDocument
Arguments:
statements:
- sid: add-read-only-perm
effect: Allow
principals:
- type: '*'
identifiers:
- '*'
actions:
- glacier:InitiateJob
- glacier:GetJobOutput
resources:
- arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive
Create Vault Resource
new Vault(name: string, args?: VaultArgs, opts?: CustomResourceOptions);
@overload
def Vault(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_policy: Optional[str] = None,
name: Optional[str] = None,
notification: Optional[VaultNotificationArgs] = None,
tags: Optional[Mapping[str, str]] = None)
@overload
def Vault(resource_name: str,
args: Optional[VaultArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewVault(ctx *Context, name string, args *VaultArgs, opts ...ResourceOption) (*Vault, error)
public Vault(string name, VaultArgs? args = null, CustomResourceOptions? opts = null)
type: aws:glacier:Vault
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Vault Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Vault resource accepts the following input properties:
- Access
Policy string The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- Name string
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
Vault
Notification The notifications for the Vault. Fields documented below.
- Dictionary<string, string>
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.
- Access
Policy string The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- Name string
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
Vault
Notification Args The notifications for the Vault. Fields documented below.
- map[string]string
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.
- access
Policy String The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- name String
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
Vault
Notification The notifications for the Vault. Fields documented below.
- Map<String,String>
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.
- access
Policy string The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- name string
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
Vault
Notification The notifications for the Vault. Fields documented below.
- {[key: string]: string}
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.
- access_
policy str The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- name str
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
Vault
Notification Args The notifications for the Vault. Fields documented below.
- Mapping[str, str]
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.
- access
Policy String The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- name String
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 Property Map
The notifications for the Vault. Fields documented below.
- Map<String>
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.
Outputs
All input properties are implicitly available as output properties. Additionally, the Vault resource produces the following output properties:
- Arn string
The ARN of the vault.
- Id string
The provider-assigned unique ID for this managed resource.
- Location string
The URI of the vault that was created.
- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- Arn string
The ARN of the vault.
- Id string
The provider-assigned unique ID for this managed resource.
- Location string
The URI of the vault that was created.
- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
The ARN of the vault.
- id String
The provider-assigned unique ID for this managed resource.
- location String
The URI of the vault that was created.
- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn string
The ARN of the vault.
- id string
The provider-assigned unique ID for this managed resource.
- location string
The URI of the vault that was created.
- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn str
The ARN of the vault.
- id str
The provider-assigned unique ID for this managed resource.
- location str
The URI of the vault that was created.
- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
The ARN of the vault.
- id String
The provider-assigned unique ID for this managed resource.
- location String
The URI of the vault that was created.
- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
Look up Existing Vault Resource
Get an existing Vault resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VaultState, opts?: CustomResourceOptions): Vault
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_policy: Optional[str] = None,
arn: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
notification: Optional[VaultNotificationArgs] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> Vault
func GetVault(ctx *Context, name string, id IDInput, state *VaultState, opts ...ResourceOption) (*Vault, error)
public static Vault Get(string name, Input<string> id, VaultState? state, CustomResourceOptions? opts = null)
public static Vault get(String name, Output<String> id, VaultState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Access
Policy string The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- Arn string
The ARN of the vault.
- Location string
The URI of the vault that was created.
- Name string
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
Vault
Notification The notifications for the Vault. Fields documented below.
- Dictionary<string, string>
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.- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- Access
Policy string The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- Arn string
The ARN of the vault.
- Location string
The URI of the vault that was created.
- Name string
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
Vault
Notification Args The notifications for the Vault. Fields documented below.
- map[string]string
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.- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- access
Policy String The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- arn String
The ARN of the vault.
- location String
The URI of the vault that was created.
- name String
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
Vault
Notification The notifications for the Vault. Fields documented below.
- Map<String,String>
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.- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- access
Policy string The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- arn string
The ARN of the vault.
- location string
The URI of the vault that was created.
- name string
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
Vault
Notification The notifications for the Vault. Fields documented below.
- {[key: string]: string}
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.- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- access_
policy str The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- arn str
The ARN of the vault.
- location str
The URI of the vault that was created.
- name str
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
Vault
Notification Args The notifications for the Vault. Fields documented below.
- Mapping[str, str]
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.- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- access
Policy String The policy document. This is a JSON formatted string. The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy- arn String
The ARN of the vault.
- location String
The URI of the vault that was created.
- name String
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 Property Map
The notifications for the Vault. Fields documented below.
- Map<String>
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.- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
Supporting Types
VaultNotification, VaultNotificationArgs
Import
Using pulumi import
, import Glacier Vaults using the name
. For example:
$ pulumi import aws:glacier/vault:Vault archive my_archive
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.