-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
r/aws_instance and r/d/aws_launch_template - cpu options #31035
Conversation
deprecate cpu_core_count and cpu_threads_per_core
migrate from deprecated args to cpu options
migrate from no args to cpu options
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
$ make testacc TESTARGS='-run=TestAccEC2LaunchTemplate_cpuOptions' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2LaunchTemplate_cpuOptions -timeout 180m
=== RUN TestAccEC2LaunchTemplate_cpuOptions
=== PAUSE TestAccEC2LaunchTemplate_cpuOptions
=== CONT TestAccEC2LaunchTemplate_cpuOptions
--- PASS: TestAccEC2LaunchTemplate_cpuOptions (14.92s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 18.150s
$ make testacc TESTARGS='-run=TestAccEC2Instance_cpuOptions\|TestInstanceCPU' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccEC2Instance_cpuOptions\|TestInstanceCPU -timeout 180m
=== RUN TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToDisabledToEnabledToUnspecified
=== PAUSE TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToDisabledToEnabledToUnspecified
=== RUN TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToEnabledToDisabledToUnspecified
=== PAUSE TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToEnabledToDisabledToUnspecified
=== RUN TestAccEC2Instance_cpuOptionsAmdSevSnpEnabledToDisabled
=== PAUSE TestAccEC2Instance_cpuOptionsAmdSevSnpEnabledToDisabled
=== RUN TestAccEC2Instance_cpuOptionsAmdSevSnpDisabledToEnabled
=== PAUSE TestAccEC2Instance_cpuOptionsAmdSevSnpDisabledToEnabled
=== RUN TestAccEC2Instance_cpuOptionsAmdSevSnpCoreThreads
=== PAUSE TestAccEC2Instance_cpuOptionsAmdSevSnpCoreThreads
=== RUN TestAccEC2Instance_cpuOptionsCoreThreads
=== PAUSE TestAccEC2Instance_cpuOptionsCoreThreads
=== RUN TestAccEC2Instance_cpuOptionsCoreThreadsMigration
=== PAUSE TestAccEC2Instance_cpuOptionsCoreThreadsMigration
=== RUN TestAccEC2Instance_cpuOptionsCoreThreadsUnspecifiedToSpecified
=== PAUSE TestAccEC2Instance_cpuOptionsCoreThreadsUnspecifiedToSpecified
=== RUN TestInstanceCPUCoreCountSchema
=== PAUSE TestInstanceCPUCoreCountSchema
=== RUN TestInstanceCPUThreadsPerCoreSchema
=== PAUSE TestInstanceCPUThreadsPerCoreSchema
=== CONT TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToDisabledToEnabledToUnspecified
=== CONT TestAccEC2Instance_cpuOptionsCoreThreads
=== CONT TestInstanceCPUCoreCountSchema
=== CONT TestInstanceCPUThreadsPerCoreSchema
=== CONT TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToEnabledToDisabledToUnspecified
=== CONT TestAccEC2Instance_cpuOptionsCoreThreadsUnspecifiedToSpecified
=== CONT TestAccEC2Instance_cpuOptionsCoreThreadsMigration
=== CONT TestAccEC2Instance_cpuOptionsAmdSevSnpDisabledToEnabled
=== CONT TestAccEC2Instance_cpuOptionsAmdSevSnpCoreThreads
=== CONT TestAccEC2Instance_cpuOptionsAmdSevSnpEnabledToDisabled
--- PASS: TestInstanceCPUCoreCountSchema (0.00s)
--- PASS: TestInstanceCPUThreadsPerCoreSchema (0.00s)
--- PASS: TestAccEC2Instance_cpuOptionsCoreThreadsMigration (87.23s)
--- PASS: TestAccEC2Instance_cpuOptionsCoreThreadsUnspecifiedToSpecified (117.56s)
--- PASS: TestAccEC2Instance_cpuOptionsCoreThreads (120.22s)
--- PASS: TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToDisabledToEnabledToUnspecified (368.04s)
--- PASS: TestAccEC2Instance_cpuOptionsAmdSevSnpEnabledToDisabled (392.68s)
--- PASS: TestAccEC2Instance_cpuOptionsAmdSevSnpDisabledToEnabled (402.45s)
--- PASS: TestAccEC2Instance_cpuOptionsAmdSevSnpCoreThreads (412.69s)
--- PASS: TestAccEC2Instance_cpuOptionsAmdSevSnpUnspecifiedToEnabledToDisabledToUnspecified (461.69s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 465.158s
Thanks for your contribution, @GlennChia! 👏 |
Thanks @jar-b! I forgot to add the results from the tests for the
|
This functionality has been released in v4.66.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. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
Feature documentation: CPU features
This PR adds support for
amd_sev_snp
argument. This is part of the cpu_options argument.As part of this PR the following changes are done
aws_instance
resource: Deprecatecpu_core_count
in favor ofcpu_options.0.core_count
aws_instance
resource: Deprecatecpu_threads_per_core
in favor ofcpu_options.0.threads_per_core
aws_instance
resource: Introducecpu_options.0.amd_sev_snp
aws_launch_template
resource: Introducecpu_options.0.amd_sev_snp
aws_launch_template
data source: Introducecpu_options.0.amd_sev_snp
NOTE: From the Requirements doc, as of this writing, only certain regions are supported. Hence, testing of
amd_sev_snp
is done inus-east-2
Test cases introduced
aws_instance
resourcecpu_options
: Create, update ofcore_count
andthreads_per_core
cpu_options
: Migration from deprecated argscpu_core_count
andcpu_threads_per_core
tocpu_options.0.core_count
andcpu_options.0.threads_per_core
cpu_options
: EC2 instance is not recreated when users transition from not specifying anycpu_options
to specifying the defaultcpu_options
cpu_options
: Create, updateamd_sev_snp
disabled
to updatedenabled
enabled
to updateddisabled
cpu_options
: Create, update ofamd_sev_snp
withcore_count
andthreads_per_core
cpu_options
: Migration from EC2 instance that does not havecpu_options
to EC2 instance that hasamd_sev_snp
set asdisabled
. Expect no recreation. Note that since the READ function is not called, the value ofamd_sev_snp
is not changed in state and will still be an empty string. From testing, the API will not returnamd_sev_snp
if it is not set as eitherdisabled
orenabled
at launch timecpu_options
: Migration from EC2 instance that hascpu_options
withamd_sev_snp
to EC2 instance withoutcpu_options
. Expect no recreationaws_launch_template
resourcecpu_options
: Create, updateamd_sev_snp
aws_launch_template
data sourcecpu_options
: Readamd_sev_snp
Relations
Closes #31036
Depends on #31028
References
Output from Acceptance Testing
aws_instance
resourceYou might encounter issues with the instance type and AZ used in the test cases. Change the AZ used in the tests accordingly to fix these errors.
aws_launch_template
resourceaws_launch_template
data source