Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d/aws_imagebuilder_distribution_configuration - add launch_template_configuration attribute #22884

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/22884.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
data-source/aws_imagebuilder_distribution_configuration: Add `launch_template_configuration` attribute to the `distribution` configuration block
```
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@ func DataSourceDistributionConfiguration() *schema.Resource {
},
},
},
"launch_template_configuration": {
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"default": {
Type: schema.TypeBool,
Computed: true,
},
"launch_template_id": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
"license_configuration_arns": {
Type: schema.TypeSet,
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ func TestAccImageBuilderDistributionConfigurationDataSource_arn(t *testing.T) {
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.0.container_distribution_configuration.0.target_repository.#", resourceName, "distribution.0.container_distribution_configuration.0.target_repository.#"),
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.0.container_distribution_configuration.0.target_repository.0.repository_name", resourceName, "distribution.0.container_distribution_configuration.0.target_repository.0.repository_name"),
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.0.container_distribution_configuration.0.target_repository.0.service", resourceName, "distribution.0.container_distribution_configuration.0.target_repository.0.service"),
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.0.launch_template_configuration.#", resourceName, "distribution.0.launch_template_configuration.#"),
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.0.launch_template_configuration.0.default", resourceName, "distribution.0.launch_template_configuration.0.default"),
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.0.launch_template_configuration.0.launch_template_id", resourceName, "distribution.0.launch_template_configuration.0.launch_template_id"),
resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"),
resource.TestCheckResourceAttrPair(dataSourceName, "tags.%", resourceName, "tags.%"),
),
Expand All @@ -47,6 +50,11 @@ func testAccDistributionConfigurationARNDataSourceConfig(rName string) string {
return fmt.Sprintf(`
data "aws_region" "current" {}

resource "aws_launch_template" "test" {
instance_type = "t2.micro"
name = %[1]q
}

resource "aws_imagebuilder_distribution_configuration" "test" {
name = %[1]q

Expand All @@ -62,6 +70,11 @@ resource "aws_imagebuilder_distribution_configuration" "test" {
}
}

launch_template_configuration {
default = false
launch_template_id = aws_launch_template.test.id
}

region = data.aws_region.current.name
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ In addition to all arguments above, the following attributes are exported:
* `target_repository` - Set of destination repositories for the container distribution configuration.
* `repository_name` - Name of the container repository where the output container image is stored.
* `service` - Service in which the image is registered.
* `launch_template_configuration` - Nested list of launch template configurations.
* `default` - Indicates whether the specified Amazon EC2 launch template is set as the default launch template.
* `launch_template_id` - ID of the Amazon EC2 launch template.
* `license_configuration_arns` - Set of Amazon Resource Names (ARNs) of License Manager License Configurations.
* `region` - AWS Region of distribution.
* `name` - Name of the distribution configuration.
Expand Down