|
| 1 | +data "aws_caller_identity" "current" { |
| 2 | +} |
| 3 | + |
| 4 | +locals { |
| 5 | + account_id = data.aws_caller_identity.current.account_id |
| 6 | + tags = module.tags.tags_no_name |
| 7 | +} |
| 8 | + |
| 9 | +module "tags" { |
| 10 | + source = "git::https://github.com/rhythmictech/terraform-terraform-tags.git?ref=v1.0.0" |
| 11 | + |
| 12 | + names = [ |
| 13 | + "smiller", |
| 14 | + "imagebuilder-test" |
| 15 | + ] |
| 16 | + |
| 17 | + tags = merge({ |
| 18 | + "Env" = "test" |
| 19 | + "Namespace" = "smiller" |
| 20 | + "notes" = "Testing only - Can be safely deleted" |
| 21 | + "Owner" = var.owner |
| 22 | + }, var.additional_tags) |
| 23 | +} |
| 24 | + |
| 25 | +module "test-component" { |
| 26 | + source = "git::https://github.com/rhythmictech/terraform-aws-imagebuilder-component-ansible.git?ref=init" |
| 27 | + |
| 28 | + component_version = "1.0.0" |
| 29 | + description = "Testing component" |
| 30 | + name = "testing-component" |
| 31 | + playbook_dir = "packer-generic-images/base" |
| 32 | + playbook_repo = "https://github.com/rhythmictech/packer-generic-images.git" |
| 33 | + tags = local.tags |
| 34 | +} |
| 35 | + |
| 36 | +module "test-recipe" { |
| 37 | + source = "git::https://github.com/rhythmictech/terraform-aws-imagebuilder-recipe.git?ref=init" |
| 38 | + |
| 39 | + description = "Testing recipe" |
| 40 | + name = "test-recipe" |
| 41 | + parent_image = "arn:aws:imagebuilder:us-east-1:aws:image/amazon-linux-2-x86/x.x.x" |
| 42 | + recipe_version = "1.0.0" |
| 43 | + tags = local.tags |
| 44 | + update = true |
| 45 | + |
| 46 | + components = [ |
| 47 | + module.test-component.component_arn, |
| 48 | + "arn:aws:imagebuilder:us-east-1:aws:component/simple-boot-test-linux/1.0.0/1", |
| 49 | + "arn:aws:imagebuilder:us-east-1:aws:component/reboot-test-linux/1.0.0/1" |
| 50 | + ] |
| 51 | +} |
| 52 | + |
| 53 | +module "test-pipeline" { |
| 54 | + source = "git::https://github.com/rhythmictech/terraform-aws-imagebuilder-pipeline.git?ref=init" |
| 55 | + |
| 56 | + description = "Testing pipeline" |
| 57 | + name = "test-pipeline" |
| 58 | + tags = local.tags |
| 59 | + recipe_arn = module.test-recipe.recipe_arn |
| 60 | +} |
0 commit comments