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 shared_accounts parameter to db_snapshot_copy #34843

Merged
merged 32 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a081a27
Add shared_accounts parameter to db_snapshot_copy
OpenGLShaders Dec 9, 2023
d72a082
formatting
OpenGLShaders Dec 10, 2023
624fb61
make it compile
OpenGLShaders Dec 10, 2023
0dac5ca
adding tests
OpenGLShaders Dec 10, 2023
c3e09ef
Merge branch 'main' into HEAD
ewbankkit Jul 23, 2024
540935a
Run 'make fix-constants PKG=rds'.
ewbankkit Jul 23, 2024
bfb2c0f
Correct CHANGELOG entry.
ewbankkit Jul 23, 2024
550b6a5
Cosmetics.
ewbankkit Jul 23, 2024
369eb17
Acceptance test output:
ewbankkit Jul 23, 2024
2bd3fd3
Add 'tfslices.PredicateValue'.
ewbankkit Jul 23, 2024
e386006
r/aws_db_snapshot: Migrate to AWS SDK for Go v2.
ewbankkit Jul 23, 2024
b0c847e
d/aws_db_snapshot: Migrate to AWS SDK for Go v2.
ewbankkit Jul 23, 2024
6451df9
r/aws_db_snapshot_copy: Migrate to AWS SDK for Go v2.
ewbankkit Jul 23, 2024
f061e67
Acceptance test output:
ewbankkit Jul 24, 2024
4c72379
Add 'TestAccRDSSnapshotCopy_destinationRegion'.
ewbankkit Jul 24, 2024
09e90c5
Acceptance test output:
ewbankkit Jul 24, 2024
917a7e9
r/aws_db_snapshot: Add '% progress' to 'waitDBSnapshotCreated'.
ewbankkit Jul 24, 2024
d5a480c
r/aws_db_snapshot_copy: Migrate 'destination_region' functionality to…
ewbankkit Jul 24, 2024
86dd6f8
d/aws_rds_reserved_instance_offering: Migrate to AWS SDK for Go v2.
ewbankkit Jul 24, 2024
4a62b96
r/aws_db_parameter_group: Migrate to AWS SDK for Go v2.
ewbankkit Jul 25, 2024
24a397b
Fix 'TestAccRDSParameterGroup_caseParameters'.
ewbankkit Jul 25, 2024
18f2da3
r/aws_rds_cluster_parameter_group: Migrate to AWS SDK for Go v2.
ewbankkit Jul 25, 2024
6826612
rds: Move flatteners and expanders around.
ewbankkit Jul 25, 2024
9606c59
r/aws_rds_cluster_endpoint: Migrate to AWS SDK for Go v2.
ewbankkit Jul 25, 2024
95815c3
r/aws_rds_cluster_endpoint: Fix acceptance tests.
ewbankkit Jul 25, 2024
ee1b5ad
r/aws_rds_cluster_role_association: Migrate to AWS SDK for Go v2.
ewbankkit Jul 25, 2024
8df8631
Fix semgrep 'ci.semgrep.pluginsdk.append-Read-to-diags'.
ewbankkit Jul 25, 2024
07d29de
Fix golangci-lint 'whitespace'.
ewbankkit Jul 25, 2024
008a0f1
Fix golangci-lint 'unparam'.
ewbankkit Jul 25, 2024
0ab5629
Merge branch 'main' into HEAD
ewbankkit Jul 25, 2024
336d2c0
Fix terrafmt error.
ewbankkit Jul 25, 2024
446ff1b
rds: Skip 'no matching RDS Reserved Instance Offering found' acceptan…
ewbankkit Jul 25, 2024
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
3 changes: 3 additions & 0 deletions .changelog/34843.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_db_snapshot_copy: Add `shared_accounts` argument
```
128 changes: 128 additions & 0 deletions internal/service/rds/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1901,3 +1901,131 @@ func waitDBClusterDeleted(ctx context.Context, conn *rds.RDS, id string, timeout

return nil, err
}

func expandScalingConfiguration(tfMap map[string]interface{}) *rds.ScalingConfiguration {
if tfMap == nil {
return nil
}

apiObject := &rds.ScalingConfiguration{}

if v, ok := tfMap["auto_pause"].(bool); ok {
apiObject.AutoPause = aws.Bool(v)
}

if v, ok := tfMap[names.AttrMaxCapacity].(int); ok {
apiObject.MaxCapacity = aws.Int64(int64(v))
}

if v, ok := tfMap["min_capacity"].(int); ok {
apiObject.MinCapacity = aws.Int64(int64(v))
}

if v, ok := tfMap["seconds_before_timeout"].(int); ok {
apiObject.SecondsBeforeTimeout = aws.Int64(int64(v))
}

if v, ok := tfMap["seconds_until_auto_pause"].(int); ok {
apiObject.SecondsUntilAutoPause = aws.Int64(int64(v))
}

if v, ok := tfMap["timeout_action"].(string); ok && v != "" {
apiObject.TimeoutAction = aws.String(v)
}

return apiObject
}

func flattenScalingConfigurationInfo(apiObject *rds.ScalingConfigurationInfo) map[string]interface{} {
if apiObject == nil {
return nil
}

tfMap := map[string]interface{}{}

if v := apiObject.AutoPause; v != nil {
tfMap["auto_pause"] = aws.BoolValue(v)
}

if v := apiObject.MaxCapacity; v != nil {
tfMap[names.AttrMaxCapacity] = aws.Int64Value(v)
}

if v := apiObject.MaxCapacity; v != nil {
tfMap[names.AttrMaxCapacity] = aws.Int64Value(v)
}

if v := apiObject.MinCapacity; v != nil {
tfMap["min_capacity"] = aws.Int64Value(v)
}

if v := apiObject.SecondsBeforeTimeout; v != nil {
tfMap["seconds_before_timeout"] = aws.Int64Value(v)
}

if v := apiObject.SecondsUntilAutoPause; v != nil {
tfMap["seconds_until_auto_pause"] = aws.Int64Value(v)
}

if v := apiObject.TimeoutAction; v != nil {
tfMap["timeout_action"] = aws.StringValue(v)
}

return tfMap
}

func expandServerlessV2ScalingConfiguration(tfMap map[string]interface{}) *rds.ServerlessV2ScalingConfiguration {
if tfMap == nil {
return nil
}

apiObject := &rds.ServerlessV2ScalingConfiguration{}

if v, ok := tfMap[names.AttrMaxCapacity].(float64); ok && v != 0.0 {
apiObject.MaxCapacity = aws.Float64(v)
}

if v, ok := tfMap["min_capacity"].(float64); ok && v != 0.0 {
apiObject.MinCapacity = aws.Float64(v)
}

return apiObject
}

func flattenServerlessV2ScalingConfigurationInfo(apiObject *rds.ServerlessV2ScalingConfigurationInfo) map[string]interface{} {
if apiObject == nil {
return nil
}

tfMap := map[string]interface{}{}

if v := apiObject.MaxCapacity; v != nil {
tfMap[names.AttrMaxCapacity] = aws.Float64Value(v)
}

if v := apiObject.MinCapacity; v != nil {
tfMap["min_capacity"] = aws.Float64Value(v)
}

return tfMap
}

// TODO Move back to 'flex.go' once migrate to AWS SDK for Go v2.
func flattenManagedMasterUserSecret(apiObject *rds.MasterUserSecret) map[string]interface{} {
if apiObject == nil {
return nil
}

tfMap := map[string]interface{}{}
if v := apiObject.KmsKeyId; v != nil {
tfMap[names.AttrKMSKeyID] = aws.StringValue(v)
}
if v := apiObject.SecretArn; v != nil {
tfMap["secret_arn"] = aws.StringValue(v)
}
if v := apiObject.SecretStatus; v != nil {
tfMap["secret_status"] = aws.StringValue(v)
}

return tfMap
}
Loading
Loading