Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Automates snapshots using the new DLM policy support in AWS and Terraform

License

NotificationsYou must be signed in to change notification settings

JamesWoolfenden/terraform-aws-dlmautosnapshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusLatest ReleaseGitHub tag (latest SemVer)Terraform VersionInfrastructure Testspre-commitcheckovInfrastructure Tests

Terraform module - creates ups data life-cycle management to automate ebs backups.


It's 100% Open Source and licensed under theAPACHE2.

Usage

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

module"dlmautowsnapshot" {source="JamesWoolfenden/dlmautowsnapshot/aws"version="0.2.9"common_tags=var.common_tagssnapshot_name=local.snapshot_namecron_expression=var.cron_expressionregions=var.regions}

The management of EC2 backup has become simpler With the new release of Data Lifecycle Manager (DLM) policieshttps://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-lifecycle.html.There is no more need for a Lambdas to manage EBS snapshots, and additionally with the new release of support for DLM in Terraformhttps://www.terraform.io/docs/providers/aws/r/dlm_lifecycle_policy.html it can achieved easily.

The example - exampleA shows how to implement a DLM policy on EBS snapshots.As before you include a reference to the module in your code.

In the example the variable schedule is an extensible list of maps.

schedule = [{name = "2 weeks of daily snapshots"create_rule=[{interval      = 24interval_unit = "HOURS"times         = ["23:45"]}]retain_rule=[{count = 14}]tags_to_add {SnapshotCreator = "DLM"}copy_tags = false}]

That's all for now.

Requirements

No requirements.

Providers

NameVersion
awsn/a

Modules

No modules.

Resources

NameType
aws_dlm_lifecycle_policy.lifecycleresource
aws_iam_role.dlm_lifecycleresource
aws_iam_role_policy.dlm_lifecycleresource
aws_iam_policy_document.dlmdata source
aws_iam_policy_document.trustdata source

Inputs

NameDescriptionTypeDefaultRequired
common_tagsImplements the common tags schememap(any)n/ayes
scheduleThe DLM Schedulelist(any)n/ayes
schedule_copy_tagsn/aboolfalseno
schedule_intervalInterval betweennumber24no
schedule_interval_unitSchedile Interval Unitstring"HOURS"no
schedule_nameName of the Schedulestring"2 weeks of daily snapshots"no
schedule_retainn/anumber14no
schedule_timesWhen the policy should runstring"23:45"no

Outputs

NameDescription
lifecyclen/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": ["dlm:CreateLifecyclePolicy","dlm:DeleteLifecyclePolicy","dlm:GetLifecyclePolicy","dlm:ListTagsForResource","dlm:UpdateLifecyclePolicy"            ],"Resource": "*"        },        {"Sid":"VisualEditor1","Effect":"Allow","Action": ["ec2:DescribeAccountAttributes"            ],"Resource": "*"        },        {"Sid":"VisualEditor2","Effect":"Allow","Action": ["iam:CreateRole","iam:DeleteRole","iam:DeleteRolePolicy","iam:GetRole","iam:GetRolePolicy","iam:ListAttachedRolePolicies","iam:ListInstanceProfilesForRole","iam:ListRolePolicies","iam:PutRolePolicy","iam:TagRole"            ],"Resource": "*"        },        {"Sid":"VisualEditor3","Effect":"Allow","Action": ["kms:DescribeKey","kms:ListAliases"            ],"Resource": "*"        }    ]})}

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHubissue.

Contributing

Bug Reports & Feature Requests

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

Copyrights

Copyright © 2019-2022 James Woolfenden

License

License

SeeLICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under oneor more contributor license agreements. See the NOTICE filedistributed with this work for additional informationregarding copyright ownership. The ASF licenses this fileto you under the Apache License, Version 2.0 (the"License"); you may not use this file except in compliancewith 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 ANYKIND, either express or implied. See the License for thespecific language governing permissions and limitationsunder the License.

Contributors

James Woolfenden
James Woolfenden

About

Automates snapshots using the new DLM policy support in AWS and Terraform

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp