Skip to content

JamesWoolfenden/terraform-aws-glacier

Repository files navigation

terraform-aws-glacier

Build Status Latest Release GitHub tag (latest SemVer) Terraform Version Infrastructure Tests pre-commit checkov Infrastructure Tests

Creates a Glacier Vault, with policy and lock.


It's 100% Open Source and licensed under the APACHE2.

Usage

Include this repository as a module in your existing terraform code:

module "glacier" {
  source       = "JamesWoolfenden/glacier/aws"
  version      = "0.0.1"
}

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_glacier_vault.example resource
aws_glacier_vault_lock.example resource
aws_sns_topic.example resource
aws_caller_identity.current data source
aws_iam_policy_document.example data source
aws_region.current data source

Inputs

Name Description Type Default Required
complete_lock Set to true for an immutable permanent lock bool false no
ignore_deletion_error Allow Terraform to ignore the error returned when attempting to delete the Glacier Lock Policy. This can be used to delete or recreate the Glacier Vault via Terraform, for example, if the Glacier Vault Lock policy permits that action. This should only be used in conjunction with complete_lock being set to true bool false no
sns_topic_name n/a string "glacier-sns-topic-" no
vault_name n/a string n/a yes

Outputs

Name Description
lock n/a
topic n/a
vault n/a

Policy

This is the policy required to build this project:

The Terraform resource required is:

resource "aws_iam_policy" "terraform_pike" {
  name_prefix = "terraform_pike"
  path        = "/"
  description = "Pike Autogenerated policy from IAC"

  policy = jsonencode({
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "SNS:CreateTopic",
                "SNS:DeleteTopic",
                "SNS:GetTopicAttributes",
                "SNS:ListTagsForResource",
                "SNS:SetTopicAttributes",
                "SNS:TagResource",
                "SNS:UnTagResource"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeAccountAttributes"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor2",
            "Effect": "Allow",
            "Action": [
                "glacier:AbortVaultLock",
                "glacier:AddTagsToVault",
                "glacier:CompleteVaultLock",
                "glacier:CreateVault",
                "glacier:DeleteVault",
                "glacier:DescribeVault",
                "glacier:GetVaultAccessPolicy",
                "glacier:GetVaultLock",
                "glacier:InitiateVaultLock",
                "glacier:ListTagsForVault",
                "glacier:RemoveTagsFromVault",
                "glacier:SetVaultAccessPolicy",
                "glacier:SetVaultNotifications"
            ],
            "Resource": "*"
        }
    ]
})
}

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHub issue.

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Copyrights

Copyright © 2019-2022 James Woolfenden

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributors

James Woolfenden
James Woolfenden