https://github.com/dod-iac/terraform-aws-image-builder-component
Creates a component for EC2 Image Builder.
https://github.com/dod-iac/terraform-aws-image-builder-component
aws ec2 imagebuilder terraform
Last synced: about 1 month ago
JSON representation
Creates a component for EC2 Image Builder.
- Host: GitHub
- URL: https://github.com/dod-iac/terraform-aws-image-builder-component
- Owner: dod-iac
- License: mit
- Created: 2022-06-08T13:58:50.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-24T18:05:28.000Z (over 3 years ago)
- Last Synced: 2025-02-26T12:14:58.075Z (over 1 year ago)
- Topics: aws, ec2, imagebuilder, terraform
- Language: HCL
- Homepage: https://registry.terraform.io/modules/dod-iac/image-builder-component/aws
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Usage
Creates a component for EC2 Image Builder.
```hcl
module "image_builder_component" {
source = "dod-iac/image-builder-component/aws"
name = format("app-%s-component-%s", var.application, var.environment)
platform = "Linux"
data = yamlencode(yamldecode(file(format("%s/data.yml", path.module))))
}
```
Creates a component from a template file for EC2 Image Builder.
```hcl
module "image_builder_component" {
source = "dod-iac/image-builder-component/aws"
name = format("app-%s-component-%s", var.application, var.environment)
platform = "Linux"
data = templatefile(format("%s/component.yml.tpl", path.module), {
account_id = data.aws_caller_identity.current.account_id
bucket = var.bucket
})
}
```
Create a series of components for EC2 Image Builder.
```hcl
module "image_builder_component" {
source = "dod-iac/image-builder-component/aws"
for_each = toset(["component-a", "component-b", "component-c"])
name = format("app-%s-%s-%s", var.application, each.key, var.environment)
platform = "Linux"
data = yamlencode(yamldecode(file(format("%s/%s.yml", path.module, each.key))))
}
```
## Terraform Version
Terraform 0.13. Pin module version to ~> 1.0.0 . Submit pull-requests to main branch.
Terraform 0.11 and 0.12 are not supported.
## License
This project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. However, because the project utilizes code licensed from contributors and other third parties, it therefore is licensed under the MIT License. See LICENSE file for more information.
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.13 |
| [aws](#requirement\_aws) | >= 3.0, < 5.0 |
## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 3.0, < 5.0 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_imagebuilder_component.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/imagebuilder_component) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [component\_version](#input\_component\_version) | The version of the component. | `string` | `"1.0.0"` | no |
| [data](#input\_data) | Inline YAML string with data of the component. Exactly one of data and uri can be specified. | `string` | `""` | no |
| [description](#input\_description) | The description of the component. | `string` | `"An component for EC2 Image Builder."` | no |
| [name](#input\_name) | The name of the component. | `string` | n/a | yes |
| [platform](#input\_platform) | The platform of the component. | `string` | n/a | yes |
| [tags](#input\_tags) | The tags applied to the component. | `map(string)` | `{}` | no |
| [uri](#input\_uri) | S3 URI with data of the component. Exactly one of data and uri can be specified. | `string` | `""` | no |
## Outputs
| Name | Description |
|------|-------------|
| [arn](#output\_arn) | The ARN of the EC2 Image Builder component. |