{"id":25010146,"url":"https://github.com/gbvanrenswoude/terraform-share-ami-module","last_synced_at":"2026-05-20T05:09:41.748Z","repository":{"id":137355536,"uuid":"343727543","full_name":"gbvanrenswoude/terraform-share-ami-module","owner":"gbvanrenswoude","description":"A Terraform module for sharing AMI using Image Permissions","archived":false,"fork":false,"pushed_at":"2021-03-02T10:43:05.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T14:05:02.668Z","etag":null,"topics":["ami","aws","module","permissions","share","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbvanrenswoude.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-02T10:04:06.000Z","updated_at":"2022-02-07T05:07:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"f1ba7ddf-5902-4a3e-8f09-270c988db27d","html_url":"https://github.com/gbvanrenswoude/terraform-share-ami-module","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gbvanrenswoude/terraform-share-ami-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbvanrenswoude%2Fterraform-share-ami-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbvanrenswoude%2Fterraform-share-ami-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbvanrenswoude%2Fterraform-share-ami-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbvanrenswoude%2Fterraform-share-ami-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbvanrenswoude","download_url":"https://codeload.github.com/gbvanrenswoude/terraform-share-ami-module/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbvanrenswoude%2Fterraform-share-ami-module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273573590,"owners_count":25129881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ami","aws","module","permissions","share","terraform"],"created_at":"2025-02-05T04:52:44.165Z","updated_at":"2026-05-20T05:09:41.723Z","avatar_url":"https://github.com/gbvanrenswoude.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform-share-ami-module\nA Terraform module for sharing AMI using Image Permissions. It tracks the newest n number of AMIs automatically and shares the new ones with your customer AWS accounts and unshares the old / unsupported ones.\n\n\n## What does the module do\nThis module fetches a list of AMIs in your account using the AMI datasource. It sorts them on date of creation, with the newest first and the oldest last.\nThen it loops thru the newest n \u003cvariable released_ami_number\u003e and makes sure they are shared with the \u003cvariable accounts_to_share_with\u003e. It will in this way automatically unshare the old AMIs and share new AMIs with a backwards support of n \u003cvariable released_ami_number\u003e.\n\nExample implementation:\n\n```hcl\nmodule \"ami_share\" {\n  source = \"../\"\n\n  ami_name_filter = \"whoo-these-are-the-amis-i-build*\"\n  ami_owner_filter   = \"616116116661\" // its me I produce AMIs in this account !\n  accounts_to_share_with = {\n    customer1 = \"616116116662\"  // my customers !\n    customer2 = \"616116116663\"\n    customer3 = \"616116116664\"\n  }\n}\n```\n\nIf you build your AMI encrypted, make sure to add grants to the KMS key for the automation roles that your customers use to spin up your AMIs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbvanrenswoude%2Fterraform-share-ami-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbvanrenswoude%2Fterraform-share-ami-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbvanrenswoude%2Fterraform-share-ami-module/lists"}