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

Add 'Context' as an optional parameter for EC2 'CreateFleet' #23304

Merged
merged 4 commits into from
Feb 22, 2022
Merged

Add 'Context' as an optional parameter for EC2 'CreateFleet' #23304

merged 4 commits into from
Feb 22, 2022

Conversation

gjmveloso
Copy link
Contributor

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 #23302

Output from acceptance testing:

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2Fleet'  -timeout 180m
=== RUN   TestAccEC2Fleet_basic
=== PAUSE TestAccEC2Fleet_basic
=== RUN   TestAccEC2Fleet_disappears
=== PAUSE TestAccEC2Fleet_disappears
=== RUN   TestAccEC2Fleet_excessCapacityTerminationPolicy
=== PAUSE TestAccEC2Fleet_excessCapacityTerminationPolicy
=== RUN   TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateID
=== PAUSE TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateID
=== RUN   TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateName
=== PAUSE TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateName
=== RUN   TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_version
=== PAUSE TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_version
=== RUN   TestAccEC2Fleet_LaunchTemplateOverride_availabilityZone
=== PAUSE TestAccEC2Fleet_LaunchTemplateOverride_availabilityZone
=== RUN   TestAccEC2Fleet_LaunchTemplateOverride_instanceType
=== PAUSE TestAccEC2Fleet_LaunchTemplateOverride_instanceType
=== RUN   TestAccEC2Fleet_LaunchTemplateOverride_maxPrice
    acctest.go:68: EC2 API is not correctly returning MaxPrice override
--- SKIP: TestAccEC2Fleet_LaunchTemplateOverride_maxPrice (0.00s)
=== RUN   TestAccEC2Fleet_LaunchTemplateOverride_priority
=== PAUSE TestAccEC2Fleet_LaunchTemplateOverride_priority
=== RUN   TestAccEC2Fleet_LaunchTemplateOverridePriority_multiple
=== PAUSE TestAccEC2Fleet_LaunchTemplateOverridePriority_multiple
=== RUN   TestAccEC2Fleet_LaunchTemplateOverride_subnetID
=== PAUSE TestAccEC2Fleet_LaunchTemplateOverride_subnetID
=== RUN   TestAccEC2Fleet_LaunchTemplateOverride_weightedCapacity
=== PAUSE TestAccEC2Fleet_LaunchTemplateOverride_weightedCapacity
=== RUN   TestAccEC2Fleet_LaunchTemplateOverrideWeightedCapacity_multiple
=== PAUSE TestAccEC2Fleet_LaunchTemplateOverrideWeightedCapacity_multiple
=== RUN   TestAccEC2Fleet_OnDemandOptions_allocationStrategy
=== PAUSE TestAccEC2Fleet_OnDemandOptions_allocationStrategy
=== RUN   TestAccEC2Fleet_replaceUnhealthyInstances
=== PAUSE TestAccEC2Fleet_replaceUnhealthyInstances
=== RUN   TestAccEC2Fleet_SpotOptions_allocationStrategy
=== PAUSE TestAccEC2Fleet_SpotOptions_allocationStrategy
=== RUN   TestAccEC2Fleet_SpotOptions_capacityRebalance
=== PAUSE TestAccEC2Fleet_SpotOptions_capacityRebalance
=== RUN   TestAccEC2Fleet_SpotOptions_instanceInterruptionBehavior
=== PAUSE TestAccEC2Fleet_SpotOptions_instanceInterruptionBehavior
=== RUN   TestAccEC2Fleet_SpotOptions_instancePoolsToUseCount
=== PAUSE TestAccEC2Fleet_SpotOptions_instancePoolsToUseCount
=== RUN   TestAccEC2Fleet_tags
=== PAUSE TestAccEC2Fleet_tags
=== RUN   TestAccEC2Fleet_TargetCapacitySpecification_defaultTargetCapacityType
=== PAUSE TestAccEC2Fleet_TargetCapacitySpecification_defaultTargetCapacityType
=== RUN   TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_onDemand
=== PAUSE TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_onDemand
=== RUN   TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_spot
=== PAUSE TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_spot
=== RUN   TestAccEC2Fleet_TargetCapacitySpecification_totalTargetCapacity
=== PAUSE TestAccEC2Fleet_TargetCapacitySpecification_totalTargetCapacity
=== RUN   TestAccEC2Fleet_terminateInstancesWithExpiration
=== PAUSE TestAccEC2Fleet_terminateInstancesWithExpiration
=== RUN   TestAccEC2Fleet_type
=== PAUSE TestAccEC2Fleet_type
=== RUN   TestAccEC2Fleet_templateMultipleNetworkInterfaces
=== PAUSE TestAccEC2Fleet_templateMultipleNetworkInterfaces
=== CONT  TestAccEC2Fleet_basic
=== CONT  TestAccEC2Fleet_replaceUnhealthyInstances
=== CONT  TestAccEC2Fleet_LaunchTemplateOverrideWeightedCapacity_multiple
=== CONT  TestAccEC2Fleet_templateMultipleNetworkInterfaces
=== CONT  TestAccEC2Fleet_LaunchTemplateOverridePriority_multiple
=== CONT  TestAccEC2Fleet_LaunchTemplateOverride_subnetID
=== CONT  TestAccEC2Fleet_OnDemandOptions_allocationStrategy
=== CONT  TestAccEC2Fleet_LaunchTemplateOverride_weightedCapacity
=== CONT  TestAccEC2Fleet_LaunchTemplateOverride_instanceType
=== CONT  TestAccEC2Fleet_tags
=== CONT  TestAccEC2Fleet_SpotOptions_instancePoolsToUseCount
=== CONT  TestAccEC2Fleet_LaunchTemplateOverride_priority
=== CONT  TestAccEC2Fleet_SpotOptions_instanceInterruptionBehavior
=== CONT  TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateName
=== CONT  TestAccEC2Fleet_SpotOptions_capacityRebalance
=== CONT  TestAccEC2Fleet_LaunchTemplateOverride_availabilityZone
=== CONT  TestAccEC2Fleet_TargetCapacitySpecification_totalTargetCapacity
=== CONT  TestAccEC2Fleet_type
=== CONT  TestAccEC2Fleet_SpotOptions_allocationStrategy
=== CONT  TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_version
=== CONT  TestAccEC2Fleet_terminateInstancesWithExpiration
--- PASS: TestAccEC2Fleet_SpotOptions_capacityRebalance (107.96s)
--- PASS: TestAccEC2Fleet_basic (120.33s)
=== CONT  TestAccEC2Fleet_excessCapacityTerminationPolicy
--- PASS: TestAccEC2Fleet_type (122.70s)
=== CONT  TestAccEC2Fleet_TargetCapacitySpecification_defaultTargetCapacityType
--- PASS: TestAccEC2Fleet_OnDemandOptions_allocationStrategy (175.64s)
=== CONT  TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateID
--- PASS: TestAccEC2Fleet_SpotOptions_instanceInterruptionBehavior (187.38s)
=== CONT  TestAccEC2Fleet_disappears
--- PASS: TestAccEC2Fleet_replaceUnhealthyInstances (187.51s)
=== CONT  TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_onDemand
--- PASS: TestAccEC2Fleet_SpotOptions_allocationStrategy (187.66s)
=== CONT  TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_spot
--- PASS: TestAccEC2Fleet_SpotOptions_instancePoolsToUseCount (187.93s)
--- PASS: TestAccEC2Fleet_LaunchTemplateOverridePriority_multiple (200.35s)
--- PASS: TestAccEC2Fleet_LaunchTemplateOverride_weightedCapacity (210.04s)
--- PASS: TestAccEC2Fleet_LaunchTemplateOverride_priority (210.10s)
--- PASS: TestAccEC2Fleet_LaunchTemplateOverride_instanceType (219.71s)
--- PASS: TestAccEC2Fleet_tags (222.73s)
--- PASS: TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_version (223.20s)
--- PASS: TestAccEC2Fleet_LaunchTemplateOverrideWeightedCapacity_multiple (223.30s)
--- PASS: TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateName (223.33s)
--- PASS: TestAccEC2Fleet_LaunchTemplateOverride_availabilityZone (223.36s)
--- PASS: TestAccEC2Fleet_LaunchTemplateOverride_subnetID (224.53s)
--- PASS: TestAccEC2Fleet_excessCapacityTerminationPolicy (120.83s)
--- PASS: TestAccEC2Fleet_terminateInstancesWithExpiration (133.70s)
--- PASS: TestAccEC2Fleet_disappears (67.90s)
--- PASS: TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_onDemand (69.92s)
--- PASS: TestAccEC2Fleet_TargetCapacitySpecification_defaultTargetCapacityType (136.75s)
--- PASS: TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_spot (75.00s)
--- PASS: TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateID (122.53s)
--- PASS: TestAccEC2Fleet_TargetCapacitySpecification_totalTargetCapacity (596.31s)
--- PASS: TestAccEC2Fleet_templateMultipleNetworkInterfaces (598.76s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        602.909s

@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/ec2 Issues and PRs that pertain to the ec2 service. labels Feb 21, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @gjmveloso 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@ewbankkit ewbankkit added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 22, 2022
@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Feb 22, 2022
@ewbankkit
Copy link
Contributor

% make testacc TESTS=TestAccEC2Fleet_basic PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2Fleet_basic'  -timeout 180m
=== RUN   TestAccEC2Fleet_basic
=== PAUSE TestAccEC2Fleet_basic
=== CONT  TestAccEC2Fleet_basic
--- PASS: TestAccEC2Fleet_basic (60.99s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	65.095s

@ewbankkit
Copy link
Contributor

@gjmveloso Thanks for the contribution 🎉 👏.
As Context is not well documented it is not clear how we should handle an update of the context argument - can it be modified after the fleet has been created?

@ewbankkit ewbankkit added the waiting-response Maintainers are waiting on response from community or contributor. label Feb 22, 2022
@gjmveloso
Copy link
Contributor Author

Hi @ewbankkit, Despite not being common having customers need to change their context on an EC2 Fleet It's possible to change it during a ModifyFleet call. Just added it as part of resourceFleetUpdate function.

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Feb 22, 2022
Copy link
Contributor

@ewbankkit ewbankkit left a 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=TestAccEC2Fleet_basic\|TestAccEC2Fleet_excessCapacityTerminationPolicy' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccEC2Fleet_basic\|TestAccEC2Fleet_excessCapacityTerminationPolicy -timeout 180m
=== RUN   TestAccEC2Fleet_basic
=== PAUSE TestAccEC2Fleet_basic
=== RUN   TestAccEC2Fleet_excessCapacityTerminationPolicy
=== PAUSE TestAccEC2Fleet_excessCapacityTerminationPolicy
=== CONT  TestAccEC2Fleet_basic
=== CONT  TestAccEC2Fleet_excessCapacityTerminationPolicy
--- PASS: TestAccEC2Fleet_basic (56.17s)
--- PASS: TestAccEC2Fleet_excessCapacityTerminationPolicy (119.73s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	123.585s

@ewbankkit ewbankkit merged commit d4e7d61 into hashicorp:main Feb 22, 2022
@github-actions github-actions bot added this to the v4.3.0 milestone Feb 22, 2022
@gjmveloso gjmveloso deleted the ec2/fleet_context branch February 22, 2022 20:52
@github-actions
Copy link

github-actions bot commented Mar 1, 2022

This functionality has been released in v4.3.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!

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2022
@justinretzolk justinretzolk added the partner Contribution from a partner. label May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. partner Contribution from a partner. service/ec2 Issues and PRs that pertain to the ec2 service. size/XS 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 optional Context for EC2 Fleet
3 participants