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 Resource: aws_imagebuilder_image_pipeline #16299

Merged
merged 28 commits into from
Nov 25, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Nov 19, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Closes #11084
Closes #13485
Reference: #16218 (required for aws_imagebuilder_image_recipe resource implementation)

Release note for CHANGELOG:

* **New Data Source:** `aws_imagebuilder_image_pipeline`
* **New Resource:** `aws_imagebuilder_image_pipeline`

Output from acceptance testing in AWS Commercial:

--- PASS: TestAccAwsImageBuilderImagePipeline_basic (36.73s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Description (59.17s)
--- PASS: TestAccAwsImageBuilderImagePipeline_disappears (28.69s)
--- PASS: TestAccAwsImageBuilderImagePipeline_DistributionConfigurationArn (62.02s)
--- PASS: TestAccAwsImageBuilderImagePipeline_EnhancedImageMetadataEnabled (61.63s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageRecipeArn (57.56s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_ImageTestsEnabled (61.52s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_TimeoutMinutes (61.49s)
--- PASS: TestAccAwsImageBuilderImagePipeline_InfrastructureConfigurationArn (57.93s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_PipelineExecutionStartCondition (61.29s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_ScheduleExpression (62.21s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Status (57.90s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Tags (73.01s)

--- PASS: TestAccAwsImageBuilderImagePipelineDataSource_Arn (33.95s)

Output from acceptance testing in AWS GovCloud (US):

--- PASS: TestAccAwsImageBuilderImagePipeline_basic (45.88s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Description (65.03s)
--- PASS: TestAccAwsImageBuilderImagePipeline_disappears (39.74s)
--- PASS: TestAccAwsImageBuilderImagePipeline_DistributionConfigurationArn (66.42s)
--- PASS: TestAccAwsImageBuilderImagePipeline_EnhancedImageMetadataEnabled (63.39s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageRecipeArn (66.54s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_ImageTestsEnabled (65.08s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_TimeoutMinutes (61.28s)
--- PASS: TestAccAwsImageBuilderImagePipeline_InfrastructureConfigurationArn (66.96s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_PipelineExecutionStartCondition (61.44s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_ScheduleExpression (60.45s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Status (65.08s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Tags (81.64s)

--- PASS: TestAccAwsImageBuilderImagePipelineDataSource_Arn (36.13s)

Output from sweeper in AWS Commercial:

2020/11/18 20:23:09 [DEBUG] Running Sweepers for region (us-west-2):
2020/11/18 20:23:09 [DEBUG] Running Sweeper (aws_imagebuilder_image_pipeline) in region (us-west-2)
2020/11/18 20:23:11 Sweeper Tests ran successfully:
  - aws_imagebuilder_image_pipeline
2020/11/18 20:23:11 [DEBUG] Running Sweepers for region (us-east-1):
2020/11/18 20:23:11 [DEBUG] Running Sweeper (aws_imagebuilder_image_pipeline) in region (us-east-1)
2020/11/18 20:23:11 Sweeper Tests ran successfully:
  - aws_imagebuilder_image_pipeline
ok    github.com/terraform-providers/terraform-provider-aws/aws 5.138s

Output from sweeper in AWS GovCloud (US):

2020/11/18 20:23:10 [DEBUG] Running Sweepers for region (us-gov-west-1):
2020/11/18 20:23:10 [DEBUG] Running Sweeper (aws_imagebuilder_image_pipeline) in region (us-gov-west-1)
2020/11/18 20:23:13 Sweeper Tests ran successfully:
  - aws_imagebuilder_image_pipeline
ok    github.com/terraform-providers/terraform-provider-aws/aws 4.805s

Dogers and others added 25 commits May 6, 2020 23:24
# Conflicts:
#	aws/provider.go
fixed lint issues and terminate_instance_on_failure
Reference: #11084
Reference: #13485
Reference: #16218 (required for `aws_imagebuilder_image_recipe` resource implementation)

Changes:

```
* **New Data Source:** `aws_imagebuilder_image_pipeline`
* **New Resource:** `aws_imagebuilder_image_pipeline`
```

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAwsImageBuilderImagePipeline_basic (36.73s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Description (59.17s)
--- PASS: TestAccAwsImageBuilderImagePipeline_disappears (28.69s)
--- PASS: TestAccAwsImageBuilderImagePipeline_DistributionConfigurationArn (62.02s)
--- PASS: TestAccAwsImageBuilderImagePipeline_EnhancedImageMetadataEnabled (61.63s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageRecipeArn (57.56s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_ImageTestsEnabled (61.52s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_TimeoutMinutes (61.49s)
--- PASS: TestAccAwsImageBuilderImagePipeline_InfrastructureConfigurationArn (57.93s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_PipelineExecutionStartCondition (61.29s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_ScheduleExpression (62.21s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Status (57.90s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Tags (73.01s)

--- PASS: TestAccAwsImageBuilderImagePipelineDataSource_Arn (33.95s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAwsImageBuilderImagePipeline_basic (45.88s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Description (65.03s)
--- PASS: TestAccAwsImageBuilderImagePipeline_disappears (39.74s)
--- PASS: TestAccAwsImageBuilderImagePipeline_DistributionConfigurationArn (66.42s)
--- PASS: TestAccAwsImageBuilderImagePipeline_EnhancedImageMetadataEnabled (63.39s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageRecipeArn (66.54s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_ImageTestsEnabled (65.08s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_TimeoutMinutes (61.28s)
--- PASS: TestAccAwsImageBuilderImagePipeline_InfrastructureConfigurationArn (66.96s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_PipelineExecutionStartCondition (61.44s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_ScheduleExpression (60.45s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Status (65.08s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Tags (81.64s)

--- PASS: TestAccAwsImageBuilderImagePipelineDataSource_Arn (36.13s)
```

Output from sweeper in AWS Commercial:

```
2020/11/18 20:23:09 [DEBUG] Running Sweepers for region (us-west-2):
2020/11/18 20:23:09 [DEBUG] Running Sweeper (aws_imagebuilder_image_pipeline) in region (us-west-2)
2020/11/18 20:23:11 Sweeper Tests ran successfully:
  - aws_imagebuilder_image_pipeline
2020/11/18 20:23:11 [DEBUG] Running Sweepers for region (us-east-1):
2020/11/18 20:23:11 [DEBUG] Running Sweeper (aws_imagebuilder_image_pipeline) in region (us-east-1)
2020/11/18 20:23:11 Sweeper Tests ran successfully:
  - aws_imagebuilder_image_pipeline
ok    github.com/terraform-providers/terraform-provider-aws/aws 5.138s
```

Output from sweeper in AWS GovCloud (US):

```
2020/11/18 20:23:10 [DEBUG] Running Sweepers for region (us-gov-west-1):
2020/11/18 20:23:10 [DEBUG] Running Sweeper (aws_imagebuilder_image_pipeline) in region (us-gov-west-1)
2020/11/18 20:23:13 Sweeper Tests ran successfully:
  - aws_imagebuilder_image_pipeline
ok    github.com/terraform-providers/terraform-provider-aws/aws 4.805s
```
@bflad bflad added new-resource Introduces a new resource. new-data-source Introduces a new data source. labels Nov 19, 2020
@bflad bflad added this to the v3.17.0 milestone Nov 19, 2020
@bflad bflad requested a review from a team as a code owner November 19, 2020 01:59
@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Nov 19, 2020
@ghost ghost added provider Pertains to the provider itself, rather than any interaction with AWS. service/imagebuilder Issues and PRs that pertain to the imagebuilder service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 19, 2020
@bflad bflad modified the milestones: v3.17.0, v3.18.0 Nov 23, 2020
@gdavison gdavison self-assigned this Nov 24, 2020
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

One suggestion and one question

--- PASS: TestAccAwsImageBuilderImagePipelineDataSource_Arn (47.87s)
--- PASS: TestAccAwsImageBuilderImagePipeline_basic (51.01s)
--- PASS: TestAccAwsImageBuilderImagePipeline_disappears (58.33s)
--- PASS: TestAccAwsImageBuilderImagePipeline_InfrastructureConfigurationArn (81.36s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageRecipeArn (81.42s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_ImageTestsEnabled (81.54s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Status (83.55s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Description (84.27s)
--- PASS: TestAccAwsImageBuilderImagePipeline_EnhancedImageMetadataEnabled (84.90s)
--- PASS: TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_TimeoutMinutes (84.85s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_ScheduleExpression (85.05s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Schedule_PipelineExecutionStartCondition (85.34s)
--- PASS: TestAccAwsImageBuilderImagePipeline_DistributionConfigurationArn (85.46s)
--- PASS: TestAccAwsImageBuilderImagePipeline_Tags (96.18s)

"infrastructure_configuration_arn": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^arn:aws[^:]*:imagebuilder:[^:]+:(?:\d{12}|aws):infrastructure-configuration/[a-z0-9-_]+$`), "valid infrastructure configuration ARN must be provided"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a case for a set of functions like ValidateRegionalARN(arnServicestring, arnResourceRegexp *regexp.Regexp) analogous to the testAccMatchResourceAttr...ARN() functions.

So we'd have something like

ValidateFunc: ValidateRegionalARN("imagebuilder", regexp.MustCompile(`infrastructure-configuration/[a-z0-9-_]+$`)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #16434 and will add to technical research board.

return nil
}

func testAccCheckAwsImageBuilderImagePipelineExists(resourceName string) resource.TestCheckFunc {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the image pipeline be returned using from the exists function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #16435 and added to technical research board.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To provide more color here, I think we can move away from those "CheckExists" functions altogether since import testing accomplishes the same thing, rather than worrying about creating those or making them consistent.

@bflad bflad merged commit d71a43a into master Nov 25, 2020
@bflad bflad deleted the f-aws_imagebuilder_image_pipeline branch November 25, 2020 15:21
bflad added a commit that referenced this pull request Nov 25, 2020
@ghost
Copy link

ghost commented Nov 25, 2020

This has been released in version 3.18.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 Dec 25, 2020

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 Dec 25, 2020
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. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/imagebuilder Issues and PRs that pertain to the imagebuilder service. size/XXL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for EC2 Image Builder
5 participants