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

New Data Source: aws_imagebuilder_image #16377

Closed
bflad opened this issue Nov 23, 2020 · 4 comments · Fixed by #16710
Closed

New Data Source: aws_imagebuilder_image #16377

bflad opened this issue Nov 23, 2020 · 4 comments · Fixed by #16710
Assignees
Labels
new-data-source Introduces a new data source. service/imagebuilder Issues and PRs that pertain to the imagebuilder service.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Nov 23, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Support lookup of an Image Builder Image.

New Data Source

  • aws_imagebuilder_image

Potential Terraform Configuration

data "aws_imagebuilder_image" "example" {
  arn   = "" # Optional
  most_recent_date_created = true # Optional
  owner = "" # Optional

  filter { # Optional
    name = "" # Required
    values = "" # Required
  }
}

Potentially can support functionality.

References

@bflad bflad added new-data-source Introduces a new data source. service/imagebuilder Issues and PRs that pertain to the imagebuilder service. labels Nov 23, 2020
@Dogers
Copy link
Contributor

Dogers commented Nov 25, 2020

The datasource makes sense to me, so you can then build upon an image in another pipeline:
AWS Base Image > Pipeline A > Image A
Image A > Pipeline B > Image B

bflad added a commit that referenced this issue Dec 11, 2020

Verified

This commit was signed with the committer’s verified signature.
Reference: #16375
Reference: #16377

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAwsImageBuilderImage_basic (1596.87s)
--- PASS: TestAccAwsImageBuilderImage_disappears (1593.54s)
--- PASS: TestAccAwsImageBuilderImage_DistributionConfigurationArn (1844.49s)
--- PASS: TestAccAwsImageBuilderImage_EnhancedImageMetadataEnabled (2636.68s)
--- PASS: TestAccAwsImageBuilderImage_ImageTestsConfiguration_ImageTestsEnabled (2616.36s)
--- PASS: TestAccAwsImageBuilderImage_ImageTestsConfiguration_TimeoutMinutes (3026.17s)
--- PASS: TestAccAwsImageBuilderImage_Tags (1514.62s)

--- PASS: TestAccAwsImageBuilderImageDataSource_Arn_Aws (12.69s)
--- PASS: TestAccAwsImageBuilderImageDataSource_Arn_Self (1458.04s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAwsImageBuilderImage_basic (1463.62s)
--- PASS: TestAccAwsImageBuilderImage_disappears (1460.27s)
--- PASS: TestAccAwsImageBuilderImage_DistributionConfigurationArn (1850.90s)
--- PASS: TestAccAwsImageBuilderImage_EnhancedImageMetadataEnabled (2648.38s)
--- PASS: TestAccAwsImageBuilderImage_ImageTestsConfiguration_ImageTestsEnabled (2648.21s)
--- PASS: TestAccAwsImageBuilderImage_ImageTestsConfiguration_TimeoutMinutes (2914.17s)
--- PASS: TestAccAwsImageBuilderImage_Tags (1643.87s)

--- PASS: TestAccAwsImageBuilderImageDataSource_Arn_Aws (19.19s)
--- PASS: TestAccAwsImageBuilderImageDataSource_Arn_Self (1462.29s)
```
@bflad bflad self-assigned this Dec 11, 2020
@bflad
Copy link
Contributor Author

bflad commented Dec 11, 2020

Submitted: #16710

This solely uses the GetImage API, whose ImageBuildVersionArn field accepts x.x.x wildcards and returns the latest image, so no extra most_recent-type argument is necessary. 👍 If the other type of filtering is desirable, it probably should be implemented in a separate plural data source (aws_imagebuilder_images) that uses the ListImages API and can return multiple results.

bflad added a commit that referenced this issue Jan 27, 2021

Verified

This commit was signed with the committer’s verified signature.
* New Resource: aws_imagebuilder_image

Reference: #16375
Reference: #16377

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAwsImageBuilderImage_basic (1596.87s)
--- PASS: TestAccAwsImageBuilderImage_disappears (1593.54s)
--- PASS: TestAccAwsImageBuilderImage_DistributionConfigurationArn (1844.49s)
--- PASS: TestAccAwsImageBuilderImage_EnhancedImageMetadataEnabled (2636.68s)
--- PASS: TestAccAwsImageBuilderImage_ImageTestsConfiguration_ImageTestsEnabled (2616.36s)
--- PASS: TestAccAwsImageBuilderImage_ImageTestsConfiguration_TimeoutMinutes (3026.17s)
--- PASS: TestAccAwsImageBuilderImage_Tags (1514.62s)

--- PASS: TestAccAwsImageBuilderImageDataSource_Arn_Aws (12.69s)
--- PASS: TestAccAwsImageBuilderImageDataSource_Arn_Self (1458.04s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAwsImageBuilderImage_basic (1463.62s)
--- PASS: TestAccAwsImageBuilderImage_disappears (1460.27s)
--- PASS: TestAccAwsImageBuilderImage_DistributionConfigurationArn (1850.90s)
--- PASS: TestAccAwsImageBuilderImage_EnhancedImageMetadataEnabled (2648.38s)
--- PASS: TestAccAwsImageBuilderImage_ImageTestsConfiguration_ImageTestsEnabled (2648.21s)
--- PASS: TestAccAwsImageBuilderImage_ImageTestsConfiguration_TimeoutMinutes (2914.17s)
--- PASS: TestAccAwsImageBuilderImage_Tags (1643.87s)

--- PASS: TestAccAwsImageBuilderImageDataSource_Arn_Aws (19.19s)
--- PASS: TestAccAwsImageBuilderImageDataSource_Arn_Self (1462.29s)
```

* Update CHANGELOG for #16710
@github-actions github-actions bot added this to the v3.26.0 milestone Jan 27, 2021
@ghost
Copy link

ghost commented Jan 28, 2021

This has been released in version 3.26.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Feb 27, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. service/imagebuilder Issues and PRs that pertain to the imagebuilder service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants