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

resource/aws_ami*: Fix ena_support attribute for copy/from_instance and uncouple common schema function #5433

Merged
merged 2 commits into from
Aug 7, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Aug 2, 2018

Regression introduced by #5395
Fixes #5431

Changes proposed in this pull request:

  • Split out resourceAwsAmiCommonSchema to aws_ami ("uncomputed" version), aws_ami_copy ("computed" version), and aws_ami_from_instance ("computed" version)
  • Ensure ena_support attribute is Computed: true for aws_ami_copy and aws_ami_from_instance

Output from acceptance testing:

5 tests passed (all tests)
=== RUN   TestAccAWSAMI_basic
--- PASS: TestAccAWSAMI_basic (56.17s)
=== RUN   TestAccAWSAMI_snapshotSize
--- PASS: TestAccAWSAMI_snapshotSize (56.51s)
=== RUN   TestAccAWSAMIFromInstance
--- PASS: TestAccAWSAMIFromInstance (143.70s)
=== RUN   TestAccAWSAMILaunchPermission_Basic
--- PASS: TestAccAWSAMILaunchPermission_Basic (333.48s)
=== RUN   TestAccAWSAMICopy
--- PASS: TestAccAWSAMICopy (464.29s)

@bflad bflad added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ec2 Issues and PRs that pertain to the ec2 service. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Aug 2, 2018
@bflad bflad added this to the v1.31.0 milestone Aug 2, 2018
@bflad bflad requested a review from a team August 2, 2018 19:19
@ghost ghost added the size/XL Managed by automation to categorize the size of a PR. label Aug 2, 2018
Copy link
Contributor

@paultyng paultyng left a comment

Choose a reason for hiding this comment

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

Is there no new acc test to demonstrate the issue?

…pyDestroy, testAccCheckAWSEbsSnapshotDestroy, and TestAccAWSAMICopy_EnaSupport

=== RUN   TestAccAWSAMICopy_basic
--- PASS: TestAccAWSAMICopy_basic (461.78s)
=== RUN   TestAccAWSAMICopy_EnaSupport
--- PASS: TestAccAWSAMICopy_EnaSupport (404.16s)
=== RUN   TestAccAWSEBSSnapshot_basic
--- PASS: TestAccAWSEBSSnapshot_basic (152.68s)
=== RUN   TestAccAWSEBSSnapshot_withDescription
--- PASS: TestAccAWSEBSSnapshot_withDescription (43.34s)
=== RUN   TestAccAWSEBSSnapshot_withKms
--- PASS: TestAccAWSEBSSnapshot_withKms (77.37s)
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Aug 4, 2018
@bflad
Copy link
Contributor Author

bflad commented Aug 4, 2018

@paultyng sorry, adding the test took longer than expected due to these older resources missing broken out acceptance test check functions.

On master:

=== RUN   TestAccAWSAMICopy_EnaSupport
--- FAIL: TestAccAWSAMICopy_EnaSupport (377.09s)
	testing.go:518: Step 0 error: After applying this step, the plan was not empty:

		DIFF:

		DESTROY/CREATE: aws_ami_copy.test
		  architecture:             "x86_64" => "<computed>"
		  ebs_block_device.#:       "1" => "<computed>"
		  ena_support:              "true" => "false" (forces new resource)
		  encrypted:                "false" => "false"
		  ephemeral_block_device.#: "0" => "<computed>"
		  image_location:           "187416307283/tf-acc-test-4368034538206458338-copy" => "<computed>"
		  kernel_id:                "" => "<computed>"
		  kms_key_id:               "" => "<computed>"
		  manage_ebs_snapshots:     "true" => "<computed>"
		  name:                     "tf-acc-test-4368034538206458338-copy" => "tf-acc-test-4368034538206458338-copy"
		  ramdisk_id:               "" => "<computed>"
		  root_device_name:         "/dev/sda1" => "<computed>"
		  root_snapshot_id:         "snap-05f26621118b88b48" => "<computed>"
		  source_ami_id:            "ami-08143070" => "ami-08143070"
		  source_ami_region:        "us-west-2" => "us-west-2"
		  sriov_net_support:        "simple" => "<computed>"
		  virtualization_type:      "hvm" => "<computed>"

On this branch:

=== RUN   TestAccAWSAMICopy_basic
--- PASS: TestAccAWSAMICopy_basic (461.78s)
=== RUN   TestAccAWSAMICopy_EnaSupport
--- PASS: TestAccAWSAMICopy_EnaSupport (404.16s)
=== RUN   TestAccAWSEBSSnapshot_basic
--- PASS: TestAccAWSEBSSnapshot_basic (152.68s)
=== RUN   TestAccAWSEBSSnapshot_withDescription
--- PASS: TestAccAWSEBSSnapshot_withDescription (43.34s)
=== RUN   TestAccAWSEBSSnapshot_withKms
--- PASS: TestAccAWSEBSSnapshot_withKms (77.37s)

@bflad bflad requested a review from paultyng August 4, 2018 01:23
Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

👍

@bflad bflad merged commit 27ef09d into master Aug 7, 2018
@bflad bflad deleted the b-aws_ami-ena_support-computed branch August 7, 2018 14:15
bflad added a commit that referenced this pull request Aug 7, 2018
@bflad
Copy link
Contributor Author

bflad commented Aug 9, 2018

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

@ghost
Copy link

ghost commented Apr 4, 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 and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ec2 Issues and PRs that pertain to the ec2 service. size/XXL Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate aws_ami* Resource Schemas
3 participants