Skip to content

Conversation

Aakkash-Suresh
Copy link
Contributor

Summary

Implements the feature requested in #3141 to allow aws.Config to hold service specific options that are automatically applied during client construction.

Problem

Currently, service specific options must be manually passed to each client creation:

ddbClient1 := dynamodb.NewFromConfig(cfg, func(o *dynamodb.Options) {
    o.DisableValidateResponseChecksum = true
})
ddbClient2 := dynamodb.NewFromConfig(cfg, func(o *dynamodb.Options) {
    o.DisableValidateResponseChecksum = true
})

Solution

Add service-specific options to aws.Config that are automatically applied during client construction:

cfg := aws.NewConfig().
    WithRegion("us-west-2").
    WithServiceOptions("DynamoDB", func(opts any) {
        if ddbOpts, ok := opts.(*dynamodb.Options); ok {
            ddbOpts.DisableValidateResponseChecksum = true
        }
    })

// Options are automatically applied
ddbClient1 := dynamodb.NewFromConfig(cfg)
ddbClient2 := dynamodb.NewFromConfig(cfg)

Related Issue

Closes #3141

@Aakkash-Suresh Aakkash-Suresh marked this pull request as ready for review July 20, 2025 07:45
@Aakkash-Suresh Aakkash-Suresh requested a review from a team as a code owner July 20, 2025 07:45
@lucix-aws
Copy link
Contributor

You're going to need to regenerate the service clients since this includes a codegen change.

@Aakkash-Suresh
Copy link
Contributor Author

Aakkash-Suresh commented Jul 22, 2025

You're going to need to regenerate the service clients since this includes a codegen change.

Service clients have been regenerated. All api_client.go files now include the ApplyServiceOptions call.

@lucix-aws Let me know if i'm missing something here.

@lucix-aws lucix-aws added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jul 28, 2025
@rittneje
Copy link

rittneje commented Aug 6, 2025

@lucix-aws Is there anything still pending for this change?

@lucix-aws
Copy link
Contributor

I'll try to find time to look at it again this week.

@lucix-aws
Copy link
Contributor

lucix-aws commented Aug 7, 2025

Ignore failing integration tests and codegen tests.

@lucix-aws lucix-aws merged commit 76aa8d7 into aws:main Aug 8, 2025
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for per-service options to aws.Config
3 participants