Skip to content

Commit

Permalink
Merge pull request #22838 from kamilturek/f-data_aws_imagebuilder_dis…
Browse files Browse the repository at this point in the history
…tribution_configuration-container-distribution-configuration

d/aws_imagebuilder_distribution_configuration - add container_distribution_configuration attribute
  • Loading branch information
ewbankkit authored Jan 31, 2022
2 parents 2486614 + d301dfa commit 28bf9be
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/22838.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 `container_distribution_configuration` attribute to the `distribution` configuration block
```
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,41 @@ func DataSourceDistributionConfiguration() *schema.Resource {
},
},
},
"container_distribution_configuration": {
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"container_tags": {
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"description": {
Type: schema.TypeString,
Computed: true,
},
"target_repository": {
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"repository_name": {
Type: schema.TypeString,
Computed: true,
},
"service": {
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 @@ -29,6 +29,12 @@ func TestAccImageBuilderDistributionConfigurationDataSource_arn(t *testing.T) {
resource.TestCheckResourceAttrPair(dataSourceName, "date_updated", resourceName, "date_updated"),
resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"),
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.#", resourceName, "distribution.#"),
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.0.container_distribution_configuration.#", resourceName, "distribution.0.container_distribution_configuration.#"),
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.0.container_distribution_configuration.0.container_tags.#", resourceName, "distribution.0.container_distribution_configuration.0.container_tags.#"),
resource.TestCheckResourceAttrPair(dataSourceName, "distribution.0.container_distribution_configuration.0.description", resourceName, "distribution.0.container_distribution_configuration.0.description"),
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, "name", resourceName, "name"),
resource.TestCheckResourceAttrPair(dataSourceName, "tags.%", resourceName, "tags.%"),
),
Expand All @@ -49,6 +55,13 @@ resource "aws_imagebuilder_distribution_configuration" "test" {
name = "{{ imagebuilder:buildDate }}"
}
container_distribution_configuration {
target_repository {
repository_name = "repository-name"
service = "ECR"
}
}
region = data.aws_region.current.name
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ In addition to all arguments above, the following attributes are exported:
* `user_groups` - Set of EC2 launch permission user groups.
* `user_ids` - Set of AWS Account identifiers.
* `target_account_ids` - Set of target AWS Account identifiers.
* `container_distribution_configuration` - Nested list of container distribution configurations.
* `container_tags` - Set of tags that are attached to the container distribution configuration.
* `description` - Description of the container distribution configuration.
* `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.
* `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

0 comments on commit 28bf9be

Please sign in to comment.