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 new resources: aws_lightsail_container_service and aws_lightsail_container_service_deployment_version #20625

Merged
merged 14 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/20625.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:new-resource
aws_lightsail_container_service
```

```release-note:new-resource
aws_lightsail_container_service_deployment_version
```
15 changes: 15 additions & 0 deletions internal/conns/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/aws/aws-sdk-go/service/globalaccelerator"
"github.com/aws/aws-sdk-go/service/kafka"
"github.com/aws/aws-sdk-go/service/kinesis"
"github.com/aws/aws-sdk-go/service/lightsail"
"github.com/aws/aws-sdk-go/service/organizations"
"github.com/aws/aws-sdk-go/service/route53"
"github.com/aws/aws-sdk-go/service/route53recoverycontrolconfig"
Expand Down Expand Up @@ -443,6 +444,20 @@ func (c *Config) Client(ctx context.Context) (interface{}, diag.Diagnostics) {
}
})

client.LightsailConn.Handlers.Retry.PushBack(func(r *request.Request) {
switch r.Operation.Name {
case "CreateContainerService", "UpdateContainerService", "CreateContainerServiceDeployment":
if tfawserr.ErrMessageContains(r.Error, lightsail.ErrCodeInvalidInputException, "Please try again in a few minutes") {
r.Retryable = aws.Bool(true)
}
case "DeleteContainerService":
if tfawserr.ErrMessageContains(r.Error, lightsail.ErrCodeInvalidInputException, "Please try again in a few minutes") ||
tfawserr.ErrMessageContains(r.Error, lightsail.ErrCodeInvalidInputException, "Please wait for it to complete before trying again") {
r.Retryable = aws.Bool(true)
}
}
})

client.OrganizationsConn.Handlers.Retry.PushBack(func(r *request.Request) {
// Retry on the following error:
// ConcurrentModificationException: AWS Organizations can't complete your request because it conflicts with another attempt to modify the same entity. Try again later.
Expand Down
14 changes: 8 additions & 6 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1629,12 +1629,14 @@ func Provider() *schema.Provider {
"aws_licensemanager_association": licensemanager.ResourceAssociation(),
"aws_licensemanager_license_configuration": licensemanager.ResourceLicenseConfiguration(),

"aws_lightsail_domain": lightsail.ResourceDomain(),
"aws_lightsail_instance": lightsail.ResourceInstance(),
"aws_lightsail_instance_public_ports": lightsail.ResourceInstancePublicPorts(),
"aws_lightsail_key_pair": lightsail.ResourceKeyPair(),
"aws_lightsail_static_ip": lightsail.ResourceStaticIP(),
"aws_lightsail_static_ip_attachment": lightsail.ResourceStaticIPAttachment(),
"aws_lightsail_container_service": lightsail.ResourceContainerService(),
"aws_lightsail_container_service_deployment_version": lightsail.ResourceContainerServiceDeploymentVersion(),
"aws_lightsail_domain": lightsail.ResourceDomain(),
"aws_lightsail_instance": lightsail.ResourceInstance(),
"aws_lightsail_instance_public_ports": lightsail.ResourceInstancePublicPorts(),
"aws_lightsail_key_pair": lightsail.ResourceKeyPair(),
"aws_lightsail_static_ip": lightsail.ResourceStaticIP(),
"aws_lightsail_static_ip_attachment": lightsail.ResourceStaticIPAttachment(),

"aws_location_map": location.ResourceMap(),
"aws_location_place_index": location.ResourcePlaceIndex(),
Expand Down
Loading