Merge pull request #51282 from austinvazquez/vendor-aws-dependencies

vendor: github.com/aws/smithy-go@v1.23.1; github.com/aws/aws-sdk-go-v2@v1.39.4; github.com/aws/aws-sdk-go-v2/*
This commit is contained in:
Austin Vazquez
2025-10-23 17:11:39 -05:00
committed by GitHub
243 changed files with 34685 additions and 3453 deletions

30
go.mod
View File

@@ -13,12 +13,12 @@ require (
github.com/Microsoft/go-winio v0.6.2
github.com/Microsoft/hcsshim v0.13.0
github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91
github.com/aws/aws-sdk-go-v2 v1.30.3
github.com/aws/aws-sdk-go-v2/config v1.27.27
github.com/aws/aws-sdk-go-v2/credentials v1.17.27
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.32.0
github.com/aws/smithy-go v1.20.3
github.com/aws/aws-sdk-go-v2 v1.39.4
github.com/aws/aws-sdk-go-v2/config v1.31.15
github.com/aws/aws-sdk-go-v2/credentials v1.18.19
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.11
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.58.5
github.com/aws/smithy-go v1.23.1
github.com/cloudflare/cfssl v1.6.4
github.com/containerd/cgroups/v3 v3.0.5
github.com/containerd/containerd/api v1.9.0
@@ -127,15 +127,15 @@ require (
github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.11 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.11 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.29.8 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.38.9 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect

60
go.sum
View File

@@ -55,36 +55,36 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA=
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY=
github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 h1:tW1/Rkad38LA15X4UQtjXZXNKsCgkshC3EbmcUmghTg=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3/go.mod h1:UbnqO+zjqk3uIt9yCACHJ9IVNhyhOCnYk8yA19SAWrM=
github.com/aws/aws-sdk-go-v2/config v1.27.27 h1:HdqgGt1OAP0HkEDDShEl0oSYa9ZZBSOmKpdpsDMdO90=
github.com/aws/aws-sdk-go-v2/config v1.27.27/go.mod h1:MVYamCg76dFNINkZFu4n4RjDixhVr51HLj4ErWzrVwg=
github.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI=
github.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.32.0 h1:VdKYfVPIDzmfSQk5gOQ5uueKiuKMkJuB/KOXmQ9Ytag=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.32.0/go.mod h1:jZNaJEtn9TLi3pfxycLz79HVkKxP8ZdYm92iaNFgBsA=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII=
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM=
github.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4/go.mod h1:0oxfLkpz3rQ/CHlx5hB7H69YUpFiI1tql6Q6Ne+1bCw=
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE=
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ=
github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE=
github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=
github.com/aws/aws-sdk-go-v2 v1.39.4 h1:qTsQKcdQPHnfGYBBs+Btl8QwxJeoWcOcPcixK90mRhg=
github.com/aws/aws-sdk-go-v2 v1.39.4/go.mod h1:yWSxrnioGUZ4WVv9TgMrNUeLV3PFESn/v+6T/Su8gnM=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.2 h1:t9yYsydLYNBk9cJ73rgPhPWqOh/52fcWDQB5b1JsKSY=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.2/go.mod h1:IusfVNTmiSN3t4rhxWFaBAqn+mcNdwKtPcV16eYdgko=
github.com/aws/aws-sdk-go-v2/config v1.31.15 h1:gE3M4xuNXfC/9bG4hyowGm/35uQTi7bUKeYs5e/6uvU=
github.com/aws/aws-sdk-go-v2/config v1.31.15/go.mod h1:HvnvGJoE2I95KAIW8kkWVPJ4XhdrlvwJpV6pEzFQa8o=
github.com/aws/aws-sdk-go-v2/credentials v1.18.19 h1:Jc1zzwkSY1QbkEcLujwqRTXOdvW8ppND3jRBb/VhBQc=
github.com/aws/aws-sdk-go-v2/credentials v1.18.19/go.mod h1:DIfQ9fAk5H0pGtnqfqkbSIzky82qYnGvh06ASQXXg6A=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.11 h1:X7X4YKb+c0rkI6d4uJ5tEMxXgCZ+jZ/D6mvkno8c8Uw=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.11/go.mod h1:EqM6vPZQsZHYvC4Cai35UDg/f5NCEU+vp0WfbVqVcZc=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.11 h1:7AANQZkF3ihM8fbdftpjhken0TP9sBzFbV/Ze/Y4HXA=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.11/go.mod h1:NTF4QCGkm6fzVwncpkFQqoquQyOolcyXfbpC98urj+c=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.11 h1:ShdtWUZT37LCAA4Mw2kJAJtzaszfSHFb5n25sdcv4YE=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.11/go.mod h1:7bUb2sSr2MZ3M/N+VyETLTQtInemHXb/Fl3s8CLzm0Y=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.58.5 h1:qAKJI7sjzA7ZzpC4POLro/9EL7EPPMFnvhYz0QTeI3o=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.58.5/go.mod h1:BQIQPqkXQUxUJ9BwkwkFTNSxXG5wx7BN/8mYQs2aAOg=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.2 h1:xtuxji5CS0JknaXoACOunXOYOQzgfTvGAc9s2QdCJA4=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.2/go.mod h1:zxwi0DIR0rcRcgdbl7E2MSOvxDyyXGBlScvBkARFaLQ=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.11 h1:GpMf3z2KJa4RnJ0ew3Hac+hRFYLZ9DDjfgXjuW+pB54=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.11/go.mod h1:6MZP3ZI4QQsgUCFTwMZA2V0sEriNQ8k2hmoHF3qjimQ=
github.com/aws/aws-sdk-go-v2/service/sso v1.29.8 h1:M5nimZmugcZUO9wG7iVtROxPhiqyZX6ejS1lxlDPbTU=
github.com/aws/aws-sdk-go-v2/service/sso v1.29.8/go.mod h1:mbef/pgKhtKRwrigPPs7SSSKZgytzP8PQ6P6JAAdqyM=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.3 h1:S5GuJZpYxE0lKeMHKn+BRTz6PTFpgThyJ+5mYfux7BM=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.3/go.mod h1:X4OF+BTd7HIb3L+tc4UlWHVrpgwZZIVENU15pRDVTI0=
github.com/aws/aws-sdk-go-v2/service/sts v1.38.9 h1:Ekml5vGg6sHSZLZJQJagefnVe6PmqC2oiRkBq4F7fU0=
github.com/aws/aws-sdk-go-v2/service/sts v1.38.9/go.mod h1:/e15V+o1zFHWdH3u7lpI3rVBcxszktIKuHKCY2/py+k=
github.com/aws/smithy-go v1.23.1 h1:sLvcH6dfAFwGkHLZ7dGiYF7aK6mg4CgKA/iDKjLDt9M=
github.com/aws/smithy-go v1.23.1/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=

33
vendor/github.com/aws/aws-sdk-go-v2/aws/checksum.go generated vendored Normal file
View File

@@ -0,0 +1,33 @@
package aws
// RequestChecksumCalculation controls request checksum calculation workflow
type RequestChecksumCalculation int
const (
// RequestChecksumCalculationUnset is the unset value for RequestChecksumCalculation
RequestChecksumCalculationUnset RequestChecksumCalculation = iota
// RequestChecksumCalculationWhenSupported indicates request checksum will be calculated
// if the operation supports input checksums
RequestChecksumCalculationWhenSupported
// RequestChecksumCalculationWhenRequired indicates request checksum will be calculated
// if required by the operation or if user elects to set a checksum algorithm in request
RequestChecksumCalculationWhenRequired
)
// ResponseChecksumValidation controls response checksum validation workflow
type ResponseChecksumValidation int
const (
// ResponseChecksumValidationUnset is the unset value for ResponseChecksumValidation
ResponseChecksumValidationUnset ResponseChecksumValidation = iota
// ResponseChecksumValidationWhenSupported indicates response checksum will be validated
// if the operation supports output checksums
ResponseChecksumValidationWhenSupported
// ResponseChecksumValidationWhenRequired indicates response checksum will only
// be validated if the operation requires output checksum validation
ResponseChecksumValidationWhenRequired
)

View File

@@ -6,6 +6,7 @@ import (
smithybearer "github.com/aws/smithy-go/auth/bearer"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// HTTPClient provides the interface to provide custom HTTPClients. Generally
@@ -165,6 +166,44 @@ type Config struct {
// Controls how a resolved AWS account ID is handled for endpoint routing.
AccountIDEndpointMode AccountIDEndpointMode
// RequestChecksumCalculation determines when request checksum calculation is performed.
//
// There are two possible values for this setting:
//
// 1. RequestChecksumCalculationWhenSupported (default): The checksum is always calculated
// if the operation supports it, regardless of whether the user sets an algorithm in the request.
//
// 2. RequestChecksumCalculationWhenRequired: The checksum is only calculated if the user
// explicitly sets a checksum algorithm in the request.
//
// This setting is sourced from the environment variable AWS_REQUEST_CHECKSUM_CALCULATION
// or the shared config profile attribute "request_checksum_calculation".
RequestChecksumCalculation RequestChecksumCalculation
// ResponseChecksumValidation determines when response checksum validation is performed
//
// There are two possible values for this setting:
//
// 1. ResponseChecksumValidationWhenSupported (default): The checksum is always validated
// if the operation supports it, regardless of whether the user sets the validation mode to ENABLED in request.
//
// 2. ResponseChecksumValidationWhenRequired: The checksum is only validated if the user
// explicitly sets the validation mode to ENABLED in the request
// This variable is sourced from environment variable AWS_RESPONSE_CHECKSUM_VALIDATION or
// the shared config profile attribute "response_checksum_validation".
ResponseChecksumValidation ResponseChecksumValidation
// Registry of HTTP interceptors.
Interceptors smithyhttp.InterceptorRegistry
// Priority list of preferred auth scheme IDs.
AuthSchemePreference []string
// ServiceOptions provides service specific configuration options that will be applied
// when constructing clients for specific services. Each callback function receives the service ID
// and the service's Options struct, allowing for dynamic configuration based on the service.
ServiceOptions []func(string, any)
}
// NewConfig returns a new Config pointer that can be chained with builder

View File

@@ -172,6 +172,17 @@ func (p *CredentialsCache) getCreds() (Credentials, bool) {
return *c, true
}
// ProviderSources returns a list of where the underlying credential provider
// has been sourced, if available. Returns empty if the provider doesn't implement
// the interface
func (p *CredentialsCache) ProviderSources() []CredentialSource {
asSource, ok := p.provider.(CredentialProviderSource)
if !ok {
return []CredentialSource{}
}
return asSource.ProviderSources()
}
// Invalidate will invalidate the cached credentials. The next call to Retrieve
// will cause the provider's Retrieve method to be called.
func (p *CredentialsCache) Invalidate() {

View File

@@ -70,6 +70,56 @@ func (AnonymousCredentials) Retrieve(context.Context) (Credentials, error) {
fmt.Errorf("the AnonymousCredentials is not a valid credential provider, and cannot be used to sign AWS requests with")
}
// CredentialSource is the source of the credential provider.
// A provider can have multiple credential sources: For example, a provider that reads a profile, calls ECS to
// get credentials and then assumes a role using STS will have all these as part of its provider chain.
type CredentialSource int
const (
// CredentialSourceUndefined is the sentinel zero value
CredentialSourceUndefined CredentialSource = iota
// CredentialSourceCode credentials resolved from code, cli parameters, session object, or client instance
CredentialSourceCode
// CredentialSourceEnvVars credentials resolved from environment variables
CredentialSourceEnvVars
// CredentialSourceEnvVarsSTSWebIDToken credentials resolved from environment variables for assuming a role with STS using a web identity token
CredentialSourceEnvVarsSTSWebIDToken
// CredentialSourceSTSAssumeRole credentials resolved from STS using AssumeRole
CredentialSourceSTSAssumeRole
// CredentialSourceSTSAssumeRoleSaml credentials resolved from STS using assume role with SAML
CredentialSourceSTSAssumeRoleSaml
// CredentialSourceSTSAssumeRoleWebID credentials resolved from STS using assume role with web identity
CredentialSourceSTSAssumeRoleWebID
// CredentialSourceSTSFederationToken credentials resolved from STS using a federation token
CredentialSourceSTSFederationToken
// CredentialSourceSTSSessionToken credentials resolved from STS using a session token S
CredentialSourceSTSSessionToken
// CredentialSourceProfile credentials resolved from a config file(s) profile with static credentials
CredentialSourceProfile
// CredentialSourceProfileSourceProfile credentials resolved from a source profile in a config file(s) profile
CredentialSourceProfileSourceProfile
// CredentialSourceProfileNamedProvider credentials resolved from a named provider in a config file(s) profile (like EcsContainer)
CredentialSourceProfileNamedProvider
// CredentialSourceProfileSTSWebIDToken credentials resolved from configuration for assuming a role with STS using web identity token in a config file(s) profile
CredentialSourceProfileSTSWebIDToken
// CredentialSourceProfileSSO credentials resolved from an SSO session in a config file(s) profile
CredentialSourceProfileSSO
// CredentialSourceSSO credentials resolved from an SSO session
CredentialSourceSSO
// CredentialSourceProfileSSOLegacy credentials resolved from an SSO session in a config file(s) profile using legacy format
CredentialSourceProfileSSOLegacy
// CredentialSourceSSOLegacy credentials resolved from an SSO session using legacy format
CredentialSourceSSOLegacy
// CredentialSourceProfileProcess credentials resolved from a process in a config file(s) profile
CredentialSourceProfileProcess
// CredentialSourceProcess credentials resolved from a process
CredentialSourceProcess
// CredentialSourceHTTP credentials resolved from an HTTP endpoint
CredentialSourceHTTP
// CredentialSourceIMDS credentials resolved from the instance metadata service (IMDS)
CredentialSourceIMDS
)
// A Credentials is the AWS credentials value for individual credential fields.
type Credentials struct {
// AWS Access key ID
@@ -125,6 +175,13 @@ type CredentialsProvider interface {
Retrieve(ctx context.Context) (Credentials, error)
}
// CredentialProviderSource allows any credential provider to track
// all providers where a credential provider were sourced. For example, if the credentials came from a
// call to a role specified in the profile, this method will give the whole breadcrumb trail
type CredentialProviderSource interface {
ProviderSources() []CredentialSource
}
// CredentialsProviderFunc provides a helper wrapping a function value to
// satisfy the CredentialsProvider interface.
type CredentialsProviderFunc func(context.Context) (Credentials, error)

View File

@@ -3,4 +3,4 @@
package aws
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.30.3"
const goModuleVersion = "1.39.4"

View File

@@ -1,320 +0,0 @@
// Package metrics implements metrics gathering for SDK development purposes.
//
// This package is designated as private and is intended for use only by the
// AWS client runtime. The exported API therein is not considered stable and
// is subject to breaking changes without notice.
package metrics
import (
"context"
"encoding/json"
"fmt"
"sync"
"time"
"github.com/aws/smithy-go/middleware"
)
const (
// ServiceIDKey is the key for the service ID metric.
ServiceIDKey = "ServiceId"
// OperationNameKey is the key for the operation name metric.
OperationNameKey = "OperationName"
// ClientRequestIDKey is the key for the client request ID metric.
ClientRequestIDKey = "ClientRequestId"
// APICallDurationKey is the key for the API call duration metric.
APICallDurationKey = "ApiCallDuration"
// APICallSuccessfulKey is the key for the API call successful metric.
APICallSuccessfulKey = "ApiCallSuccessful"
// MarshallingDurationKey is the key for the marshalling duration metric.
MarshallingDurationKey = "MarshallingDuration"
// InThroughputKey is the key for the input throughput metric.
InThroughputKey = "InThroughput"
// OutThroughputKey is the key for the output throughput metric.
OutThroughputKey = "OutThroughput"
// RetryCountKey is the key for the retry count metric.
RetryCountKey = "RetryCount"
// HTTPStatusCodeKey is the key for the HTTP status code metric.
HTTPStatusCodeKey = "HttpStatusCode"
// AWSExtendedRequestIDKey is the key for the AWS extended request ID metric.
AWSExtendedRequestIDKey = "AwsExtendedRequestId"
// AWSRequestIDKey is the key for the AWS request ID metric.
AWSRequestIDKey = "AwsRequestId"
// BackoffDelayDurationKey is the key for the backoff delay duration metric.
BackoffDelayDurationKey = "BackoffDelayDuration"
// StreamThroughputKey is the key for the stream throughput metric.
StreamThroughputKey = "Throughput"
// ConcurrencyAcquireDurationKey is the key for the concurrency acquire duration metric.
ConcurrencyAcquireDurationKey = "ConcurrencyAcquireDuration"
// PendingConcurrencyAcquiresKey is the key for the pending concurrency acquires metric.
PendingConcurrencyAcquiresKey = "PendingConcurrencyAcquires"
// SigningDurationKey is the key for the signing duration metric.
SigningDurationKey = "SigningDuration"
// UnmarshallingDurationKey is the key for the unmarshalling duration metric.
UnmarshallingDurationKey = "UnmarshallingDuration"
// TimeToFirstByteKey is the key for the time to first byte metric.
TimeToFirstByteKey = "TimeToFirstByte"
// ServiceCallDurationKey is the key for the service call duration metric.
ServiceCallDurationKey = "ServiceCallDuration"
// EndpointResolutionDurationKey is the key for the endpoint resolution duration metric.
EndpointResolutionDurationKey = "EndpointResolutionDuration"
// AttemptNumberKey is the key for the attempt number metric.
AttemptNumberKey = "AttemptNumber"
// MaxConcurrencyKey is the key for the max concurrency metric.
MaxConcurrencyKey = "MaxConcurrency"
// AvailableConcurrencyKey is the key for the available concurrency metric.
AvailableConcurrencyKey = "AvailableConcurrency"
)
// MetricPublisher provides the interface to provide custom MetricPublishers.
// PostRequestMetrics will be invoked by the MetricCollection middleware to post request.
// PostStreamMetrics will be invoked by ReadCloserWithMetrics to post stream metrics.
type MetricPublisher interface {
PostRequestMetrics(*MetricData) error
PostStreamMetrics(*MetricData) error
}
// Serializer provides the interface to provide custom Serializers.
// Serialize will transform any input object in its corresponding string representation.
type Serializer interface {
Serialize(obj interface{}) (string, error)
}
// DefaultSerializer is an implementation of the Serializer interface.
type DefaultSerializer struct{}
// Serialize uses the default JSON serializer to obtain the string representation of an object.
func (DefaultSerializer) Serialize(obj interface{}) (string, error) {
bytes, err := json.Marshal(obj)
if err != nil {
return "", err
}
return string(bytes), nil
}
type metricContextKey struct{}
// MetricContext contains fields to store metric-related information.
type MetricContext struct {
connectionCounter *SharedConnectionCounter
publisher MetricPublisher
data *MetricData
}
// MetricData stores the collected metric data.
type MetricData struct {
RequestStartTime time.Time
RequestEndTime time.Time
APICallDuration time.Duration
SerializeStartTime time.Time
SerializeEndTime time.Time
MarshallingDuration time.Duration
ResolveEndpointStartTime time.Time
ResolveEndpointEndTime time.Time
EndpointResolutionDuration time.Duration
GetIdentityStartTime time.Time
GetIdentityEndTime time.Time
InThroughput float64
OutThroughput float64
RetryCount int
Success uint8
StatusCode int
ClientRequestID string
ServiceID string
OperationName string
PartitionID string
Region string
UserAgent string
RequestContentLength int64
Stream StreamMetrics
Attempts []AttemptMetrics
}
// StreamMetrics stores metrics related to streaming data.
type StreamMetrics struct {
ReadDuration time.Duration
ReadBytes int64
Throughput float64
}
// AttemptMetrics stores metrics related to individual attempts.
type AttemptMetrics struct {
ServiceCallStart time.Time
ServiceCallEnd time.Time
ServiceCallDuration time.Duration
FirstByteTime time.Time
TimeToFirstByte time.Duration
ConnRequestedTime time.Time
ConnObtainedTime time.Time
ConcurrencyAcquireDuration time.Duration
SignStartTime time.Time
SignEndTime time.Time
SigningDuration time.Duration
DeserializeStartTime time.Time
DeserializeEndTime time.Time
UnMarshallingDuration time.Duration
RetryDelay time.Duration
ResponseContentLength int64
StatusCode int
RequestID string
ExtendedRequestID string
HTTPClient string
MaxConcurrency int
PendingConnectionAcquires int
AvailableConcurrency int
ActiveRequests int
ReusedConnection bool
}
// Data returns the MetricData associated with the MetricContext.
func (mc *MetricContext) Data() *MetricData {
return mc.data
}
// ConnectionCounter returns the SharedConnectionCounter associated with the MetricContext.
func (mc *MetricContext) ConnectionCounter() *SharedConnectionCounter {
return mc.connectionCounter
}
// Publisher returns the MetricPublisher associated with the MetricContext.
func (mc *MetricContext) Publisher() MetricPublisher {
return mc.publisher
}
// ComputeRequestMetrics calculates and populates derived metrics based on the collected data.
func (md *MetricData) ComputeRequestMetrics() {
for idx := range md.Attempts {
attempt := &md.Attempts[idx]
attempt.ConcurrencyAcquireDuration = attempt.ConnObtainedTime.Sub(attempt.ConnRequestedTime)
attempt.SigningDuration = attempt.SignEndTime.Sub(attempt.SignStartTime)
attempt.UnMarshallingDuration = attempt.DeserializeEndTime.Sub(attempt.DeserializeStartTime)
attempt.TimeToFirstByte = attempt.FirstByteTime.Sub(attempt.ServiceCallStart)
attempt.ServiceCallDuration = attempt.ServiceCallEnd.Sub(attempt.ServiceCallStart)
}
md.APICallDuration = md.RequestEndTime.Sub(md.RequestStartTime)
md.MarshallingDuration = md.SerializeEndTime.Sub(md.SerializeStartTime)
md.EndpointResolutionDuration = md.ResolveEndpointEndTime.Sub(md.ResolveEndpointStartTime)
md.RetryCount = len(md.Attempts) - 1
latestAttempt, err := md.LatestAttempt()
if err != nil {
fmt.Printf("error retrieving attempts data due to: %s. Skipping Throughput metrics", err.Error())
} else {
md.StatusCode = latestAttempt.StatusCode
if md.Success == 1 {
if latestAttempt.ResponseContentLength > 0 && latestAttempt.ServiceCallDuration > 0 {
md.InThroughput = float64(latestAttempt.ResponseContentLength) / latestAttempt.ServiceCallDuration.Seconds()
}
if md.RequestContentLength > 0 && latestAttempt.ServiceCallDuration > 0 {
md.OutThroughput = float64(md.RequestContentLength) / latestAttempt.ServiceCallDuration.Seconds()
}
}
}
}
// LatestAttempt returns the latest attempt metrics.
// It returns an error if no attempts are initialized.
func (md *MetricData) LatestAttempt() (*AttemptMetrics, error) {
if md.Attempts == nil || len(md.Attempts) == 0 {
return nil, fmt.Errorf("no attempts initialized. NewAttempt() should be called first")
}
return &md.Attempts[len(md.Attempts)-1], nil
}
// NewAttempt initializes new attempt metrics.
func (md *MetricData) NewAttempt() {
if md.Attempts == nil {
md.Attempts = []AttemptMetrics{}
}
md.Attempts = append(md.Attempts, AttemptMetrics{})
}
// SharedConnectionCounter is a counter shared across API calls.
type SharedConnectionCounter struct {
mu sync.Mutex
activeRequests int
pendingConnectionAcquire int
}
// ActiveRequests returns the count of active requests.
func (cc *SharedConnectionCounter) ActiveRequests() int {
cc.mu.Lock()
defer cc.mu.Unlock()
return cc.activeRequests
}
// PendingConnectionAcquire returns the count of pending connection acquires.
func (cc *SharedConnectionCounter) PendingConnectionAcquire() int {
cc.mu.Lock()
defer cc.mu.Unlock()
return cc.pendingConnectionAcquire
}
// AddActiveRequest increments the count of active requests.
func (cc *SharedConnectionCounter) AddActiveRequest() {
cc.mu.Lock()
defer cc.mu.Unlock()
cc.activeRequests++
}
// RemoveActiveRequest decrements the count of active requests.
func (cc *SharedConnectionCounter) RemoveActiveRequest() {
cc.mu.Lock()
defer cc.mu.Unlock()
cc.activeRequests--
}
// AddPendingConnectionAcquire increments the count of pending connection acquires.
func (cc *SharedConnectionCounter) AddPendingConnectionAcquire() {
cc.mu.Lock()
defer cc.mu.Unlock()
cc.pendingConnectionAcquire++
}
// RemovePendingConnectionAcquire decrements the count of pending connection acquires.
func (cc *SharedConnectionCounter) RemovePendingConnectionAcquire() {
cc.mu.Lock()
defer cc.mu.Unlock()
cc.pendingConnectionAcquire--
}
// InitMetricContext initializes the metric context with the provided counter and publisher.
// It returns the updated context.
func InitMetricContext(
ctx context.Context, counter *SharedConnectionCounter, publisher MetricPublisher,
) context.Context {
if middleware.GetStackValue(ctx, metricContextKey{}) == nil {
ctx = middleware.WithStackValue(ctx, metricContextKey{}, &MetricContext{
connectionCounter: counter,
publisher: publisher,
data: &MetricData{
Attempts: []AttemptMetrics{},
Stream: StreamMetrics{},
},
})
}
return ctx
}
// Context returns the metric context from the given context.
// It returns nil if the metric context is not found.
func Context(ctx context.Context) *MetricContext {
mctx := middleware.GetStackValue(ctx, metricContextKey{})
if mctx == nil {
return nil
}
return mctx.(*MetricContext)
}

View File

@@ -4,6 +4,7 @@ import (
"context"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/tracing"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -45,6 +46,9 @@ func (m *RequestIDRetriever) HandleDeserialize(ctx context.Context, in middlewar
if v := resp.Header.Get(h); len(v) != 0 {
// set reqID on metadata for successful responses.
SetRequestIDMetadata(&metadata, v)
span, _ := tracing.GetSpan(ctx)
span.SetProperty("aws.request_id", v)
break
}
}

View File

@@ -34,6 +34,9 @@ const (
FeatureMetadata2
)
// Hardcoded value to specify which version of the user agent we're using
const uaMetadata = "ua/2.1"
func (k SDKAgentKeyType) string() string {
switch k {
case APIMetadata:
@@ -73,20 +76,92 @@ type UserAgentFeature string
// Enumerates UserAgentFeature.
const (
UserAgentFeatureResourceModel UserAgentFeature = "A" // n/a (we don't generate separate resource types)
UserAgentFeatureWaiter = "B"
UserAgentFeaturePaginator = "C"
UserAgentFeatureRetryModeLegacy = "D" // n/a (equivalent to standard)
UserAgentFeatureRetryModeStandard = "E"
UserAgentFeatureRetryModeAdaptive = "F"
UserAgentFeatureS3Transfer = "G"
UserAgentFeatureS3CryptoV1N = "H" // n/a (crypto client is external)
UserAgentFeatureS3CryptoV2 = "I" // n/a
UserAgentFeatureS3ExpressBucket = "J"
UserAgentFeatureS3AccessGrants = "K" // not yet implemented
UserAgentFeatureGZIPRequestCompression = "L"
UserAgentFeatureResourceModel UserAgentFeature = "A" // n/a (we don't generate separate resource types)
UserAgentFeatureWaiter = "B"
UserAgentFeaturePaginator = "C"
UserAgentFeatureRetryModeLegacy = "D" // n/a (equivalent to standard)
UserAgentFeatureRetryModeStandard = "E"
UserAgentFeatureRetryModeAdaptive = "F"
UserAgentFeatureS3Transfer = "G"
UserAgentFeatureS3CryptoV1N = "H" // n/a (crypto client is external)
UserAgentFeatureS3CryptoV2 = "I" // n/a
UserAgentFeatureS3ExpressBucket = "J"
UserAgentFeatureS3AccessGrants = "K" // not yet implemented
UserAgentFeatureGZIPRequestCompression = "L"
UserAgentFeatureProtocolRPCV2CBOR = "M"
UserAgentFeatureAccountIDEndpoint = "O" // DO NOT IMPLEMENT: rules output is not currently defined. SDKs should not parse endpoints for feature information.
UserAgentFeatureAccountIDModePreferred = "P"
UserAgentFeatureAccountIDModeDisabled = "Q"
UserAgentFeatureAccountIDModeRequired = "R"
UserAgentFeatureRequestChecksumCRC32 = "U"
UserAgentFeatureRequestChecksumCRC32C = "V"
UserAgentFeatureRequestChecksumCRC64 = "W"
UserAgentFeatureRequestChecksumSHA1 = "X"
UserAgentFeatureRequestChecksumSHA256 = "Y"
UserAgentFeatureRequestChecksumWhenSupported = "Z"
UserAgentFeatureRequestChecksumWhenRequired = "a"
UserAgentFeatureResponseChecksumWhenSupported = "b"
UserAgentFeatureResponseChecksumWhenRequired = "c"
UserAgentFeatureDynamoDBUserAgent = "d" // not yet implemented
UserAgentFeatureCredentialsCode = "e"
UserAgentFeatureCredentialsJvmSystemProperties = "f" // n/a (this is not a JVM sdk)
UserAgentFeatureCredentialsEnvVars = "g"
UserAgentFeatureCredentialsEnvVarsStsWebIDToken = "h"
UserAgentFeatureCredentialsStsAssumeRole = "i"
UserAgentFeatureCredentialsStsAssumeRoleSaml = "j" // not yet implemented
UserAgentFeatureCredentialsStsAssumeRoleWebID = "k"
UserAgentFeatureCredentialsStsFederationToken = "l" // not yet implemented
UserAgentFeatureCredentialsStsSessionToken = "m" // not yet implemented
UserAgentFeatureCredentialsProfile = "n"
UserAgentFeatureCredentialsProfileSourceProfile = "o"
UserAgentFeatureCredentialsProfileNamedProvider = "p"
UserAgentFeatureCredentialsProfileStsWebIDToken = "q"
UserAgentFeatureCredentialsProfileSso = "r"
UserAgentFeatureCredentialsSso = "s"
UserAgentFeatureCredentialsProfileSsoLegacy = "t"
UserAgentFeatureCredentialsSsoLegacy = "u"
UserAgentFeatureCredentialsProfileProcess = "v"
UserAgentFeatureCredentialsProcess = "w"
UserAgentFeatureCredentialsBoto2ConfigFile = "x" // n/a (this is not boto/Python)
UserAgentFeatureCredentialsAwsSdkStore = "y" // n/a (this is used by .NET based sdk)
UserAgentFeatureCredentialsHTTP = "z"
UserAgentFeatureCredentialsIMDS = "0"
UserAgentFeatureBearerServiceEnvVars = "3"
)
var credentialSourceToFeature = map[aws.CredentialSource]UserAgentFeature{
aws.CredentialSourceCode: UserAgentFeatureCredentialsCode,
aws.CredentialSourceEnvVars: UserAgentFeatureCredentialsEnvVars,
aws.CredentialSourceEnvVarsSTSWebIDToken: UserAgentFeatureCredentialsEnvVarsStsWebIDToken,
aws.CredentialSourceSTSAssumeRole: UserAgentFeatureCredentialsStsAssumeRole,
aws.CredentialSourceSTSAssumeRoleSaml: UserAgentFeatureCredentialsStsAssumeRoleSaml,
aws.CredentialSourceSTSAssumeRoleWebID: UserAgentFeatureCredentialsStsAssumeRoleWebID,
aws.CredentialSourceSTSFederationToken: UserAgentFeatureCredentialsStsFederationToken,
aws.CredentialSourceSTSSessionToken: UserAgentFeatureCredentialsStsSessionToken,
aws.CredentialSourceProfile: UserAgentFeatureCredentialsProfile,
aws.CredentialSourceProfileSourceProfile: UserAgentFeatureCredentialsProfileSourceProfile,
aws.CredentialSourceProfileNamedProvider: UserAgentFeatureCredentialsProfileNamedProvider,
aws.CredentialSourceProfileSTSWebIDToken: UserAgentFeatureCredentialsProfileStsWebIDToken,
aws.CredentialSourceProfileSSO: UserAgentFeatureCredentialsProfileSso,
aws.CredentialSourceSSO: UserAgentFeatureCredentialsSso,
aws.CredentialSourceProfileSSOLegacy: UserAgentFeatureCredentialsProfileSsoLegacy,
aws.CredentialSourceSSOLegacy: UserAgentFeatureCredentialsSsoLegacy,
aws.CredentialSourceProfileProcess: UserAgentFeatureCredentialsProfileProcess,
aws.CredentialSourceProcess: UserAgentFeatureCredentialsProcess,
aws.CredentialSourceHTTP: UserAgentFeatureCredentialsHTTP,
aws.CredentialSourceIMDS: UserAgentFeatureCredentialsIMDS,
}
// RequestUserAgent is a build middleware that set the User-Agent for the request.
type RequestUserAgent struct {
sdkAgent, userAgent *smithyhttp.UserAgentBuilder
@@ -106,6 +181,7 @@ type RequestUserAgent struct {
func NewRequestUserAgent() *RequestUserAgent {
userAgent, sdkAgent := smithyhttp.NewUserAgentBuilder(), smithyhttp.NewUserAgentBuilder()
addProductName(userAgent)
addUserAgentMetadata(userAgent)
addProductName(sdkAgent)
r := &RequestUserAgent{
@@ -133,6 +209,10 @@ func addProductName(builder *smithyhttp.UserAgentBuilder) {
builder.AddKeyValue(aws.SDKName, aws.SDKVersion)
}
func addUserAgentMetadata(builder *smithyhttp.UserAgentBuilder) {
builder.AddKey(uaMetadata)
}
// AddUserAgentKey retrieves a requestUserAgent from the provided stack, or initializes one.
func AddUserAgentKey(key string) func(*middleware.Stack) error {
return func(stack *middleware.Stack) error {
@@ -234,6 +314,14 @@ func (u *RequestUserAgent) AddSDKAgentKeyValue(keyType SDKAgentKeyType, key, val
u.userAgent.AddKeyValue(keyType.string(), strings.Map(rules, key)+"#"+strings.Map(rules, value))
}
// AddCredentialsSource adds the credential source as a feature on the User-Agent string
func (u *RequestUserAgent) AddCredentialsSource(source aws.CredentialSource) {
x, ok := credentialSourceToFeature[source]
if ok {
u.AddUserAgentFeature(x)
}
}
// ID the name of the middleware.
func (u *RequestUserAgent) ID() string {
return "UserAgent"
@@ -257,10 +345,10 @@ func (u *RequestUserAgent) HandleBuild(ctx context.Context, in middleware.BuildI
func (u *RequestUserAgent) addHTTPUserAgent(request *smithyhttp.Request) {
const userAgent = "User-Agent"
updateHTTPHeader(request, userAgent, u.userAgent.Build())
if len(u.features) > 0 {
updateHTTPHeader(request, userAgent, buildFeatureMetrics(u.features))
}
updateHTTPHeader(request, userAgent, u.userAgent.Build())
}
func (u *RequestUserAgent) addHTTPSDKAgent(request *smithyhttp.Request) {

View File

@@ -1,3 +1,47 @@
# v1.7.2 (2025-10-16)
* **Dependency Update**: Bump minimum Go version to 1.23.
# v1.7.1 (2025-08-27)
* **Dependency Update**: Update to smithy-go v1.23.0.
# v1.7.0 (2025-07-28)
* **Feature**: Add support for HTTP interceptors.
# v1.6.11 (2025-06-17)
* **Dependency Update**: Update to smithy-go v1.22.4.
# v1.6.10 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
# v1.6.9 (2025-02-14)
* **Bug Fix**: Remove max limit on event stream messages
# v1.6.8 (2025-01-24)
* **Dependency Update**: Upgrade to smithy-go v1.22.2.
# v1.6.7 (2024-11-18)
* **Dependency Update**: Update to smithy-go v1.22.1.
# v1.6.6 (2024-10-04)
* No change notes available for this release.
# v1.6.5 (2024-09-20)
* No change notes available for this release.
# v1.6.4 (2024-08-15)
* **Dependency Update**: Bump minimum Go version to 1.21.
# v1.6.3 (2024-06-28)
* No change notes available for this release.

View File

@@ -3,4 +3,4 @@
package eventstream
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.6.3"
const goModuleVersion = "1.7.2"

View File

@@ -10,9 +10,6 @@ const preludeLen = 8
const preludeCRCLen = 4
const msgCRCLen = 4
const minMsgLen = preludeLen + preludeCRCLen + msgCRCLen
const maxPayloadLen = 1024 * 1024 * 16 // 16MB
const maxHeadersLen = 1024 * 128 // 128KB
const maxMsgLen = minMsgLen + maxHeadersLen + maxPayloadLen
var crc32IEEETable = crc32.MakeTable(crc32.IEEE)
@@ -82,28 +79,13 @@ func (p messagePrelude) PayloadLen() uint32 {
}
func (p messagePrelude) ValidateLens() error {
if p.Length == 0 || p.Length > maxMsgLen {
if p.Length == 0 {
return LengthError{
Part: "message prelude",
Want: maxMsgLen,
Want: minMsgLen,
Have: int(p.Length),
}
}
if p.HeadersLen > maxHeadersLen {
return LengthError{
Part: "message headers",
Want: maxHeadersLen,
Have: int(p.HeadersLen),
}
}
if payloadLen := p.PayloadLen(); payloadLen > maxPayloadLen {
return LengthError{
Part: "message payload",
Want: maxPayloadLen,
Have: int(payloadLen),
}
}
return nil
}

View File

@@ -1,8 +1,8 @@
package query
import (
"fmt"
"net/url"
"strconv"
)
// Array represents the encoding of Query lists and sets. A Query array is a
@@ -21,19 +21,8 @@ type Array struct {
// keys for each element in the list. For example, an entry might have the
// key "ParentStructure.ListName.member.MemberName.1".
//
// While this is currently represented as a string that gets added to, it
// could also be represented as a stack that only gets condensed into a
// string when a finalized key is created. This could potentially reduce
// allocations.
// When the array is not flat the prefix will contain the memberName otherwise the memberName is ignored
prefix string
// Whether the list is flat or not. A list that is not flat will produce the
// following entry to the url.Values for a given entry:
// ListName.MemberName.1=value
// A list that is flat will produce the following:
// ListName.1=value
flat bool
// The location name of the member. In most cases this should be "member".
memberName string
// Elements are stored in values, so we keep track of the list size here.
size int32
// Empty lists are encoded as "<prefix>=", if we add a value later we will
@@ -45,11 +34,14 @@ func newArray(values url.Values, prefix string, flat bool, memberName string) *A
emptyValue := newValue(values, prefix, flat)
emptyValue.String("")
if !flat {
// This uses string concatenation in place of fmt.Sprintf as fmt.Sprintf has a much higher resource overhead
prefix = prefix + keySeparator + memberName
}
return &Array{
values: values,
prefix: prefix,
flat: flat,
memberName: memberName,
emptyValue: emptyValue,
}
}
@@ -63,10 +55,7 @@ func (a *Array) Value() Value {
// Query lists start a 1, so adjust the size first
a.size++
prefix := a.prefix
if !a.flat {
prefix = fmt.Sprintf("%s.%s", prefix, a.memberName)
}
// Lists can't have flat members
return newValue(a.values, fmt.Sprintf("%s.%d", prefix, a.size), false)
// This uses string concatenation in place of fmt.Sprintf as fmt.Sprintf has a much higher resource overhead
return newValue(a.values, a.prefix+keySeparator+strconv.FormatInt(int64(a.size), 10), false)
}

View File

@@ -1,9 +1,6 @@
package query
import (
"fmt"
"net/url"
)
import "net/url"
// Object represents the encoding of Query structures and unions. A Query
// object is a representation of a mapping of string keys to arbitrary
@@ -56,14 +53,16 @@ func (o *Object) FlatKey(name string) Value {
func (o *Object) key(name string, flatValue bool) Value {
if o.prefix != "" {
return newValue(o.values, fmt.Sprintf("%s.%s", o.prefix, name), flatValue)
// This uses string concatenation in place of fmt.Sprintf as fmt.Sprintf has a much higher resource overhead
return newValue(o.values, o.prefix+keySeparator+name, flatValue)
}
return newValue(o.values, name, flatValue)
}
func (o *Object) keyWithValues(name string, flatValue bool) Value {
if o.prefix != "" {
return newAppendValue(o.values, fmt.Sprintf("%s.%s", o.prefix, name), flatValue)
// This uses string concatenation in place of fmt.Sprintf as fmt.Sprintf has a much higher resource overhead
return newAppendValue(o.values, o.prefix+keySeparator+name, flatValue)
}
return newAppendValue(o.values, name, flatValue)
}

View File

@@ -7,6 +7,8 @@ import (
"github.com/aws/smithy-go/encoding/httpbinding"
)
const keySeparator = "."
// Value represents a Query Value type.
type Value struct {
// The query values to add the value to.

View File

@@ -0,0 +1,51 @@
package retry
import (
"context"
"github.com/aws/smithy-go/metrics"
"github.com/aws/smithy-go/middleware"
)
type attemptMetrics struct {
Attempts metrics.Int64Counter
Errors metrics.Int64Counter
AttemptDuration metrics.Float64Histogram
}
func newAttemptMetrics(meter metrics.Meter) (*attemptMetrics, error) {
m := &attemptMetrics{}
var err error
m.Attempts, err = meter.Int64Counter("client.call.attempts", func(o *metrics.InstrumentOptions) {
o.UnitLabel = "{attempt}"
o.Description = "The number of attempts for an individual operation"
})
if err != nil {
return nil, err
}
m.Errors, err = meter.Int64Counter("client.call.errors", func(o *metrics.InstrumentOptions) {
o.UnitLabel = "{error}"
o.Description = "The number of errors for an operation"
})
if err != nil {
return nil, err
}
m.AttemptDuration, err = meter.Float64Histogram("client.call.attempt_duration", func(o *metrics.InstrumentOptions) {
o.UnitLabel = "s"
o.Description = "The time it takes to connect to the service, send the request, and get back HTTP status code and headers (including time queued waiting to be sent)"
})
if err != nil {
return nil, err
}
return m, nil
}
func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption {
return func(o *metrics.RecordMetricOptions) {
o.Properties.Set("rpc.service", middleware.GetServiceID(ctx))
o.Properties.Set("rpc.method", middleware.GetOperationName(ctx))
}
}

View File

@@ -8,14 +8,16 @@ import (
"strings"
"time"
"github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics"
internalcontext "github.com/aws/aws-sdk-go-v2/internal/context"
"github.com/aws/smithy-go"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddle "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/internal/sdk"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/metrics"
smithymiddle "github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/tracing"
"github.com/aws/smithy-go/transport/http"
)
@@ -38,6 +40,9 @@ type Attempt struct {
// attempts are reached.
LogAttempts bool
// A Meter instance for recording retry-related metrics.
OperationMeter metrics.Meter
retryer aws.RetryerV2
requestCloner RequestCloner
}
@@ -55,6 +60,10 @@ func NewAttemptMiddleware(retryer aws.Retryer, requestCloner RequestCloner, optF
for _, fn := range optFns {
fn(m)
}
if m.OperationMeter == nil {
m.OperationMeter = metrics.NopMeterProvider{}.Meter("")
}
return m
}
@@ -80,6 +89,11 @@ func (r *Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeIn
maxAttempts := r.retryer.MaxAttempts()
releaseRetryToken := nopRelease
retryMetrics, err := newAttemptMetrics(r.OperationMeter)
if err != nil {
return out, metadata, err
}
for {
attemptNum++
attemptInput := in
@@ -97,7 +111,25 @@ func (r *Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeIn
ctx = internalcontext.SetAttemptSkewContext(ctx, attemptClockSkew)
var attemptResult AttemptResult
attemptCtx, span := tracing.StartSpan(attemptCtx, "Attempt", func(o *tracing.SpanOptions) {
o.Properties.Set("operation.attempt", attemptNum)
})
retryMetrics.Attempts.Add(ctx, 1, withOperationMetadata(ctx))
start := sdk.NowTime()
out, attemptResult, releaseRetryToken, err = r.handleAttempt(attemptCtx, attemptInput, releaseRetryToken, next)
elapsed := sdk.NowTime().Sub(start)
retryMetrics.AttemptDuration.Record(ctx, float64(elapsed)/1e9, withOperationMetadata(ctx))
if err != nil {
retryMetrics.Errors.Add(ctx, 1, withOperationMetadata(ctx), func(o *metrics.RecordMetricOptions) {
o.Properties.Set("exception.type", errorType(err))
})
}
span.End()
attemptClockSkew, _ = awsmiddle.GetAttemptSkew(attemptResult.ResponseMetadata)
// AttemptResult Retried states that the attempt was not successful, and
@@ -228,7 +260,7 @@ func (r *Attempt) handleAttempt(
// Get a retry token that will be released after the
releaseRetryToken, retryTokenErr := r.retryer.GetRetryToken(ctx, err)
if retryTokenErr != nil {
return out, attemptResult, nopRelease, retryTokenErr
return out, attemptResult, nopRelease, errors.Join(err, retryTokenErr)
}
//------------------------------
@@ -238,13 +270,6 @@ func (r *Attempt) handleAttempt(
// that time. Potentially early exist if the sleep is canceled via the
// context.
retryDelay, reqErr := r.retryer.RetryDelay(attemptNum, err)
mctx := metrics.Context(ctx)
if mctx != nil {
attempt, err := mctx.Data().LatestAttempt()
if err != nil {
attempt.RetryDelay = retryDelay
}
}
if reqErr != nil {
return out, attemptResult, releaseRetryToken, reqErr
}
@@ -381,3 +406,13 @@ func AddRetryMiddlewares(stack *smithymiddle.Stack, options AddRetryMiddlewaresO
}
return nil
}
// Determines the value of exception.type for metrics purposes. We prefer an
// API-specific error code, otherwise it's just the Go type for the value.
func errorType(err error) string {
var terr smithy.APIError
if errors.As(err, &terr) {
return terr.ErrorCode()
}
return fmt.Sprintf("%T", err)
}

View File

@@ -116,7 +116,13 @@ func (r RetryableConnectionError) IsErrorRetryable(err error) aws.Ternary {
case errors.As(err, &conErr) && conErr.ConnectionError():
retryable = true
case strings.Contains(err.Error(), "use of closed network connection"):
fallthrough
case strings.Contains(err.Error(), "connection reset"):
// The errors "connection reset" and "use of closed network connection"
// are effectively the same. It appears to be the difference between
// sync and async read of TCP RST in the stdlib's net.Conn read loop.
// see #2737
retryable = true
case errors.As(err, &urlErr):

View File

@@ -4,10 +4,11 @@ package v4
var IgnoredHeaders = Rules{
ExcludeList{
MapRule{
"Authorization": struct{}{},
"User-Agent": struct{}{},
"X-Amzn-Trace-Id": struct{}{},
"Expect": struct{}{},
"Authorization": struct{}{},
"User-Agent": struct{}{},
"X-Amzn-Trace-Id": struct{}{},
"Expect": struct{}{},
"Transfer-Encoding": struct{}{},
},
},
}
@@ -45,7 +46,6 @@ var RequiredSignedHeaders = Rules{
"X-Amz-Grant-Write-Acp": struct{}{},
"X-Amz-Metadata-Directive": struct{}{},
"X-Amz-Mfa": struct{}{},
"X-Amz-Request-Payer": struct{}{},
"X-Amz-Server-Side-Encryption": struct{}{},
"X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id": struct{}{},
"X-Amz-Server-Side-Encryption-Context": struct{}{},

View File

@@ -15,6 +15,7 @@ import (
internalauth "github.com/aws/aws-sdk-go-v2/internal/auth"
"github.com/aws/aws-sdk-go-v2/internal/sdk"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/tracing"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -161,6 +162,9 @@ func (m *ComputePayloadSHA256) HandleFinalize(
return next.HandleFinalize(ctx, in)
}
_, span := tracing.StartSpan(ctx, "ComputePayloadSHA256")
defer span.End()
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &HashComputationError{
@@ -186,6 +190,7 @@ func (m *ComputePayloadSHA256) HandleFinalize(
ctx = SetPayloadHash(ctx, hex.EncodeToString(hash.Sum(nil)))
span.End()
return next.HandleFinalize(ctx, in)
}
@@ -367,8 +372,9 @@ func GetSignedRequestSignature(r *http.Request) ([]byte, error) {
const authHeaderSignatureElem = "Signature="
if auth := r.Header.Get(authorizationHeader); len(auth) != 0 {
ps := strings.Split(auth, ", ")
ps := strings.Split(auth, ",")
for _, p := range ps {
p = strings.TrimSpace(p)
if idx := strings.Index(p, authHeaderSignatureElem); idx >= 0 {
sig := p[len(authHeaderSignatureElem):]
if len(sig) == 0 {

View File

@@ -59,7 +59,7 @@ func (s *StreamSigner) GetSignature(ctx context.Context, headers, payload []byte
prevSignature := s.prevSignature
st := v4Internal.NewSigningTime(signingTime)
st := v4Internal.NewSigningTime(signingTime.UTC())
sigKey := s.signingKeyDeriver.DeriveKey(s.credentials, s.service, s.region, st)

View File

@@ -394,11 +394,16 @@ func (s *httpSigner) buildCredentialScope() string {
func buildQuery(r v4Internal.Rule, header http.Header) (url.Values, http.Header) {
query := url.Values{}
unsignedHeaders := http.Header{}
// A list of headers to be converted to lower case to mitigate a limitation from S3
lowerCaseHeaders := map[string]string{
"X-Amz-Expected-Bucket-Owner": "x-amz-expected-bucket-owner", // see #2508
"X-Amz-Request-Payer": "x-amz-request-payer", // see #2764
}
for k, h := range header {
// literally just this header has this constraint for some stupid reason,
// see #2508
if k == "X-Amz-Expected-Bucket-Owner" {
k = "x-amz-expected-bucket-owner"
if newKey, ok := lowerCaseHeaders[k]; ok {
k = newKey
}
if r.IsValid(k) {

View File

@@ -1,13 +1,16 @@
package http
import (
"context"
"crypto/tls"
"github.com/aws/aws-sdk-go-v2/aws"
"net"
"net/http"
"reflect"
"sync"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/tracing"
)
// Defaults for the HTTPTransportBuilder.
@@ -179,7 +182,7 @@ func defaultHTTPTransport() *http.Transport {
tr := &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: dialer.DialContext,
DialContext: traceDialContext(dialer.DialContext),
TLSHandshakeTimeout: DefaultHTTPTransportTLSHandleshakeTimeout,
MaxIdleConns: DefaultHTTPTransportMaxIdleConns,
MaxIdleConnsPerHost: DefaultHTTPTransportMaxIdleConnsPerHost,
@@ -194,6 +197,35 @@ func defaultHTTPTransport() *http.Transport {
return tr
}
type dialContext func(ctx context.Context, network, addr string) (net.Conn, error)
func traceDialContext(dc dialContext) dialContext {
return func(ctx context.Context, network, addr string) (net.Conn, error) {
span, _ := tracing.GetSpan(ctx)
span.SetProperty("net.peer.name", addr)
conn, err := dc(ctx, network, addr)
if err != nil {
return conn, err
}
raddr := conn.RemoteAddr()
if raddr == nil {
return conn, err
}
host, port, err := net.SplitHostPort(raddr.String())
if err != nil { // don't blow up just because we couldn't parse
span.SetProperty("net.peer.addr", raddr.String())
} else {
span.SetProperty("net.peer.host", host)
span.SetProperty("net.peer.port", port)
}
return conn, err
}
}
// shallowCopyStruct creates a shallow copy of the passed in source struct, and
// returns that copy of the same struct type.
func shallowCopyStruct(src interface{}) interface{} {

View File

@@ -1,3 +1,283 @@
# v1.31.15 (2025-10-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.14 (2025-10-22)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.13 (2025-10-16)
* **Dependency Update**: Bump minimum Go version to 1.23.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.12 (2025-09-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.11 (2025-09-26)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.10 (2025-09-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.9 (2025-09-22)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.8 (2025-09-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.7 (2025-09-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.6 (2025-08-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.5 (2025-08-28)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.4 (2025-08-27)
* **Dependency Update**: Update to smithy-go v1.23.0.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.3 (2025-08-26)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.2 (2025-08-21)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.1 (2025-08-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.31.0 (2025-08-11)
* **Feature**: Add support for configuring per-service Options via callback on global config.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.30.3 (2025-08-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.30.2 (2025-07-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.30.1 (2025-07-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.30.0 (2025-07-28)
* **Feature**: Add support for HTTP interceptors.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.18 (2025-07-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.17 (2025-06-17)
* **Dependency Update**: Update to smithy-go v1.22.4.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.16 (2025-06-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.15 (2025-06-06)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.14 (2025-04-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.13 (2025-04-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.12 (2025-03-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.11 (2025-03-25)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.10 (2025-03-24)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.9 (2025-03-04.2)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.8 (2025-02-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.7 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.6 (2025-02-05)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.5 (2025-02-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.4 (2025-01-31)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.3 (2025-01-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.2 (2025-01-24)
* **Bug Fix**: Fix env config naming and usage of deprecated ioutil
* **Dependency Update**: Updated to the latest SDK module versions
* **Dependency Update**: Upgrade to smithy-go v1.22.2.
# v1.29.1 (2025-01-17)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.29.0 (2025-01-15)
* **Feature**: S3 client behavior is updated to always calculate a checksum by default for operations that support it (such as PutObject or UploadPart), or require it (such as DeleteObjects). The checksum algorithm used by default now becomes CRC32. Checksum behavior can be configured using `when_supported` and `when_required` options - in code using RequestChecksumCalculation, in shared config using request_checksum_calculation, or as env variable using AWS_REQUEST_CHECKSUM_CALCULATION. The S3 client attempts to validate response checksums for all S3 API operations that support checksums. However, if the SDK has not implemented the specified checksum algorithm then this validation is skipped. Checksum validation behavior can be configured using `when_supported` and `when_required` options - in code using ResponseChecksumValidation, in shared config using response_checksum_validation, or as env variable using AWS_RESPONSE_CHECKSUM_VALIDATION.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.11 (2025-01-14)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.10 (2025-01-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.9 (2025-01-09)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.8 (2025-01-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.7 (2024-12-19)
* **Bug Fix**: Fix improper use of printf-style functions.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.6 (2024-12-02)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.5 (2024-11-18)
* **Dependency Update**: Update to smithy-go v1.22.1.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.4 (2024-11-14)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.3 (2024-11-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.2 (2024-11-06)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.1 (2024-10-28)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.0 (2024-10-16)
* **Feature**: Adds the LoadOptions hook `WithBaseEndpoint` for setting global endpoint override in-code.
# v1.27.43 (2024-10-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.42 (2024-10-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.41 (2024-10-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.40 (2024-10-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.39 (2024-09-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.38 (2024-09-25)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.37 (2024-09-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.36 (2024-09-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.35 (2024-09-17)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.34 (2024-09-16)
* **Bug Fix**: Read `AWS_CONTAINER_CREDENTIALS_FULL_URI` env variable if set when reading a profile with `credential_source`. Also ensure `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is always read before it
# v1.27.33 (2024-09-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.32 (2024-09-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.31 (2024-08-26)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.30 (2024-08-23)
* **Bug Fix**: Don't fail credentials unit tests if credentials are found on a file
# v1.27.29 (2024-08-22)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.28 (2024-08-15)
* **Dependency Update**: Bump minimum Go version to 1.21.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.27.27 (2024-07-18)
* **Dependency Update**: Updated to the latest SDK module versions

View File

@@ -0,0 +1,19 @@
package config
import "strings"
func toAuthSchemePreferenceList(cfg string) []string {
if len(cfg) == 0 {
return nil
}
parts := strings.Split(cfg, ",")
ids := make([]string, 0, len(parts))
for _, p := range parts {
if id := strings.TrimSpace(p); len(id) > 0 {
ids = append(ids, id)
}
}
return ids
}

View File

@@ -83,6 +83,19 @@ var defaultAWSConfigResolvers = []awsConfigResolver{
// Sets the AccountIDEndpointMode if present in env var or shared config profile
resolveAccountIDEndpointMode,
// Sets the RequestChecksumCalculation if present in env var or shared config profile
resolveRequestChecksumCalculation,
// Sets the ResponseChecksumValidation if present in env var or shared config profile
resolveResponseChecksumValidation,
resolveInterceptors,
resolveAuthSchemePreference,
// Sets the ServiceOptions if present in LoadOptions
resolveServiceOptions,
}
// A Config represents a generic configuration value or set of values. This type
@@ -212,7 +225,7 @@ func resolveConfigLoaders(options *LoadOptions) []loader {
loaders[0] = loadEnvConfig
// specification of a profile should cause a load failure if it doesn't exist
if os.Getenv(awsProfileEnvVar) != "" || options.SharedConfigProfile != "" {
if os.Getenv(awsProfileEnv) != "" || options.SharedConfigProfile != "" {
loaders[1] = loadSharedConfig
} else {
loaders[1] = loadSharedConfigIgnoreNotExist

View File

@@ -5,7 +5,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"strconv"
"strings"
@@ -21,86 +20,91 @@ const CredentialsSourceName = "EnvConfigCredentials"
// Environment variables that will be read for configuration values.
const (
awsAccessKeyIDEnvVar = "AWS_ACCESS_KEY_ID"
awsAccessKeyEnvVar = "AWS_ACCESS_KEY"
awsAccessKeyIDEnv = "AWS_ACCESS_KEY_ID"
awsAccessKeyEnv = "AWS_ACCESS_KEY"
awsSecretAccessKeyEnvVar = "AWS_SECRET_ACCESS_KEY"
awsSecretKeyEnvVar = "AWS_SECRET_KEY"
awsSecretAccessKeyEnv = "AWS_SECRET_ACCESS_KEY"
awsSecretKeyEnv = "AWS_SECRET_KEY"
awsSessionTokenEnvVar = "AWS_SESSION_TOKEN"
awsSessionTokenEnv = "AWS_SESSION_TOKEN"
awsContainerCredentialsEndpointEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI"
awsContainerCredentialsRelativePathEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
awsContainerPProviderAuthorizationEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN"
awsContainerCredentialsFullURIEnv = "AWS_CONTAINER_CREDENTIALS_FULL_URI"
awsContainerCredentialsRelativeURIEnv = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
awsContainerAuthorizationTokenEnv = "AWS_CONTAINER_AUTHORIZATION_TOKEN"
awsRegionEnvVar = "AWS_REGION"
awsDefaultRegionEnvVar = "AWS_DEFAULT_REGION"
awsRegionEnv = "AWS_REGION"
awsDefaultRegionEnv = "AWS_DEFAULT_REGION"
awsProfileEnvVar = "AWS_PROFILE"
awsDefaultProfileEnvVar = "AWS_DEFAULT_PROFILE"
awsProfileEnv = "AWS_PROFILE"
awsDefaultProfileEnv = "AWS_DEFAULT_PROFILE"
awsSharedCredentialsFileEnvVar = "AWS_SHARED_CREDENTIALS_FILE"
awsSharedCredentialsFileEnv = "AWS_SHARED_CREDENTIALS_FILE"
awsConfigFileEnvVar = "AWS_CONFIG_FILE"
awsConfigFileEnv = "AWS_CONFIG_FILE"
awsCustomCABundleEnvVar = "AWS_CA_BUNDLE"
awsCABundleEnv = "AWS_CA_BUNDLE"
awsWebIdentityTokenFilePathEnvVar = "AWS_WEB_IDENTITY_TOKEN_FILE"
awsWebIdentityTokenFileEnv = "AWS_WEB_IDENTITY_TOKEN_FILE"
awsRoleARNEnvVar = "AWS_ROLE_ARN"
awsRoleSessionNameEnvVar = "AWS_ROLE_SESSION_NAME"
awsRoleARNEnv = "AWS_ROLE_ARN"
awsRoleSessionNameEnv = "AWS_ROLE_SESSION_NAME"
awsEnableEndpointDiscoveryEnvVar = "AWS_ENABLE_ENDPOINT_DISCOVERY"
awsEnableEndpointDiscoveryEnv = "AWS_ENABLE_ENDPOINT_DISCOVERY"
awsS3UseARNRegionEnvVar = "AWS_S3_USE_ARN_REGION"
awsS3UseARNRegionEnv = "AWS_S3_USE_ARN_REGION"
awsEc2MetadataServiceEndpointModeEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"
awsEc2MetadataServiceEndpointModeEnv = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"
awsEc2MetadataServiceEndpointEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT"
awsEc2MetadataServiceEndpointEnv = "AWS_EC2_METADATA_SERVICE_ENDPOINT"
awsEc2MetadataDisabled = "AWS_EC2_METADATA_DISABLED"
awsEc2MetadataV1DisabledEnvVar = "AWS_EC2_METADATA_V1_DISABLED"
awsEc2MetadataDisabledEnv = "AWS_EC2_METADATA_DISABLED"
awsEc2MetadataV1DisabledEnv = "AWS_EC2_METADATA_V1_DISABLED"
awsS3DisableMultiRegionAccessPointEnvVar = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS"
awsS3DisableMultiRegionAccessPointsEnv = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS"
awsUseDualStackEndpoint = "AWS_USE_DUALSTACK_ENDPOINT"
awsUseDualStackEndpointEnv = "AWS_USE_DUALSTACK_ENDPOINT"
awsUseFIPSEndpoint = "AWS_USE_FIPS_ENDPOINT"
awsUseFIPSEndpointEnv = "AWS_USE_FIPS_ENDPOINT"
awsDefaultMode = "AWS_DEFAULTS_MODE"
awsDefaultsModeEnv = "AWS_DEFAULTS_MODE"
awsRetryMaxAttempts = "AWS_MAX_ATTEMPTS"
awsRetryMode = "AWS_RETRY_MODE"
awsSdkAppID = "AWS_SDK_UA_APP_ID"
awsMaxAttemptsEnv = "AWS_MAX_ATTEMPTS"
awsRetryModeEnv = "AWS_RETRY_MODE"
awsSdkUaAppIDEnv = "AWS_SDK_UA_APP_ID"
awsIgnoreConfiguredEndpoints = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS"
awsEndpointURL = "AWS_ENDPOINT_URL"
awsIgnoreConfiguredEndpointURLEnv = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS"
awsEndpointURLEnv = "AWS_ENDPOINT_URL"
awsDisableRequestCompression = "AWS_DISABLE_REQUEST_COMPRESSION"
awsRequestMinCompressionSizeBytes = "AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES"
awsDisableRequestCompressionEnv = "AWS_DISABLE_REQUEST_COMPRESSION"
awsRequestMinCompressionSizeBytesEnv = "AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES"
awsS3DisableExpressSessionAuthEnv = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH"
awsAccountIDEnv = "AWS_ACCOUNT_ID"
awsAccountIDEndpointModeEnv = "AWS_ACCOUNT_ID_ENDPOINT_MODE"
awsRequestChecksumCalculation = "AWS_REQUEST_CHECKSUM_CALCULATION"
awsResponseChecksumValidation = "AWS_RESPONSE_CHECKSUM_VALIDATION"
awsAuthSchemePreferenceEnv = "AWS_AUTH_SCHEME_PREFERENCE"
)
var (
credAccessEnvKeys = []string{
awsAccessKeyIDEnvVar,
awsAccessKeyEnvVar,
awsAccessKeyIDEnv,
awsAccessKeyEnv,
}
credSecretEnvKeys = []string{
awsSecretAccessKeyEnvVar,
awsSecretKeyEnvVar,
awsSecretAccessKeyEnv,
awsSecretKeyEnv,
}
regionEnvKeys = []string{
awsRegionEnvVar,
awsDefaultRegionEnvVar,
awsRegionEnv,
awsDefaultRegionEnv,
}
profileEnvKeys = []string{
awsProfileEnvVar,
awsDefaultProfileEnvVar,
awsProfileEnv,
awsDefaultProfileEnv,
}
)
@@ -296,6 +300,15 @@ type EnvConfig struct {
// Indicates whether account ID will be required/ignored in endpoint2.0 routing
AccountIDEndpointMode aws.AccountIDEndpointMode
// Indicates whether request checksum should be calculated
RequestChecksumCalculation aws.RequestChecksumCalculation
// Indicates whether response checksum should be validated
ResponseChecksumValidation aws.ResponseChecksumValidation
// Priority list of preferred auth scheme names (e.g. sigv4a).
AuthSchemePreference []string
}
// loadEnvConfig reads configuration values from the OS's environment variables.
@@ -316,79 +329,79 @@ func NewEnvConfig() (EnvConfig, error) {
setStringFromEnvVal(&creds.SecretAccessKey, credSecretEnvKeys)
if creds.HasKeys() {
creds.AccountID = os.Getenv(awsAccountIDEnv)
creds.SessionToken = os.Getenv(awsSessionTokenEnvVar)
creds.SessionToken = os.Getenv(awsSessionTokenEnv)
cfg.Credentials = creds
}
cfg.ContainerCredentialsEndpoint = os.Getenv(awsContainerCredentialsEndpointEnvVar)
cfg.ContainerCredentialsRelativePath = os.Getenv(awsContainerCredentialsRelativePathEnvVar)
cfg.ContainerAuthorizationToken = os.Getenv(awsContainerPProviderAuthorizationEnvVar)
cfg.ContainerCredentialsEndpoint = os.Getenv(awsContainerCredentialsFullURIEnv)
cfg.ContainerCredentialsRelativePath = os.Getenv(awsContainerCredentialsRelativeURIEnv)
cfg.ContainerAuthorizationToken = os.Getenv(awsContainerAuthorizationTokenEnv)
setStringFromEnvVal(&cfg.Region, regionEnvKeys)
setStringFromEnvVal(&cfg.SharedConfigProfile, profileEnvKeys)
cfg.SharedCredentialsFile = os.Getenv(awsSharedCredentialsFileEnvVar)
cfg.SharedConfigFile = os.Getenv(awsConfigFileEnvVar)
cfg.SharedCredentialsFile = os.Getenv(awsSharedCredentialsFileEnv)
cfg.SharedConfigFile = os.Getenv(awsConfigFileEnv)
cfg.CustomCABundle = os.Getenv(awsCustomCABundleEnvVar)
cfg.CustomCABundle = os.Getenv(awsCABundleEnv)
cfg.WebIdentityTokenFilePath = os.Getenv(awsWebIdentityTokenFilePathEnvVar)
cfg.WebIdentityTokenFilePath = os.Getenv(awsWebIdentityTokenFileEnv)
cfg.RoleARN = os.Getenv(awsRoleARNEnvVar)
cfg.RoleSessionName = os.Getenv(awsRoleSessionNameEnvVar)
cfg.RoleARN = os.Getenv(awsRoleARNEnv)
cfg.RoleSessionName = os.Getenv(awsRoleSessionNameEnv)
cfg.AppID = os.Getenv(awsSdkAppID)
cfg.AppID = os.Getenv(awsSdkUaAppIDEnv)
if err := setBoolPtrFromEnvVal(&cfg.DisableRequestCompression, []string{awsDisableRequestCompression}); err != nil {
if err := setBoolPtrFromEnvVal(&cfg.DisableRequestCompression, []string{awsDisableRequestCompressionEnv}); err != nil {
return cfg, err
}
if err := setInt64PtrFromEnvVal(&cfg.RequestMinCompressSizeBytes, []string{awsRequestMinCompressionSizeBytes}, smithyrequestcompression.MaxRequestMinCompressSizeBytes); err != nil {
if err := setInt64PtrFromEnvVal(&cfg.RequestMinCompressSizeBytes, []string{awsRequestMinCompressionSizeBytesEnv}, smithyrequestcompression.MaxRequestMinCompressSizeBytes); err != nil {
return cfg, err
}
if err := setEndpointDiscoveryTypeFromEnvVal(&cfg.EnableEndpointDiscovery, []string{awsEnableEndpointDiscoveryEnvVar}); err != nil {
if err := setEndpointDiscoveryTypeFromEnvVal(&cfg.EnableEndpointDiscovery, []string{awsEnableEndpointDiscoveryEnv}); err != nil {
return cfg, err
}
if err := setBoolPtrFromEnvVal(&cfg.S3UseARNRegion, []string{awsS3UseARNRegionEnvVar}); err != nil {
if err := setBoolPtrFromEnvVal(&cfg.S3UseARNRegion, []string{awsS3UseARNRegionEnv}); err != nil {
return cfg, err
}
setEC2IMDSClientEnableState(&cfg.EC2IMDSClientEnableState, []string{awsEc2MetadataDisabled})
if err := setEC2IMDSEndpointMode(&cfg.EC2IMDSEndpointMode, []string{awsEc2MetadataServiceEndpointModeEnvVar}); err != nil {
setEC2IMDSClientEnableState(&cfg.EC2IMDSClientEnableState, []string{awsEc2MetadataDisabledEnv})
if err := setEC2IMDSEndpointMode(&cfg.EC2IMDSEndpointMode, []string{awsEc2MetadataServiceEndpointModeEnv}); err != nil {
return cfg, err
}
cfg.EC2IMDSEndpoint = os.Getenv(awsEc2MetadataServiceEndpointEnvVar)
if err := setBoolPtrFromEnvVal(&cfg.EC2IMDSv1Disabled, []string{awsEc2MetadataV1DisabledEnvVar}); err != nil {
cfg.EC2IMDSEndpoint = os.Getenv(awsEc2MetadataServiceEndpointEnv)
if err := setBoolPtrFromEnvVal(&cfg.EC2IMDSv1Disabled, []string{awsEc2MetadataV1DisabledEnv}); err != nil {
return cfg, err
}
if err := setBoolPtrFromEnvVal(&cfg.S3DisableMultiRegionAccessPoints, []string{awsS3DisableMultiRegionAccessPointEnvVar}); err != nil {
if err := setBoolPtrFromEnvVal(&cfg.S3DisableMultiRegionAccessPoints, []string{awsS3DisableMultiRegionAccessPointsEnv}); err != nil {
return cfg, err
}
if err := setUseDualStackEndpointFromEnvVal(&cfg.UseDualStackEndpoint, []string{awsUseDualStackEndpoint}); err != nil {
if err := setUseDualStackEndpointFromEnvVal(&cfg.UseDualStackEndpoint, []string{awsUseDualStackEndpointEnv}); err != nil {
return cfg, err
}
if err := setUseFIPSEndpointFromEnvVal(&cfg.UseFIPSEndpoint, []string{awsUseFIPSEndpoint}); err != nil {
if err := setUseFIPSEndpointFromEnvVal(&cfg.UseFIPSEndpoint, []string{awsUseFIPSEndpointEnv}); err != nil {
return cfg, err
}
if err := setDefaultsModeFromEnvVal(&cfg.DefaultsMode, []string{awsDefaultMode}); err != nil {
if err := setDefaultsModeFromEnvVal(&cfg.DefaultsMode, []string{awsDefaultsModeEnv}); err != nil {
return cfg, err
}
if err := setIntFromEnvVal(&cfg.RetryMaxAttempts, []string{awsRetryMaxAttempts}); err != nil {
if err := setIntFromEnvVal(&cfg.RetryMaxAttempts, []string{awsMaxAttemptsEnv}); err != nil {
return cfg, err
}
if err := setRetryModeFromEnvVal(&cfg.RetryMode, []string{awsRetryMode}); err != nil {
if err := setRetryModeFromEnvVal(&cfg.RetryMode, []string{awsRetryModeEnv}); err != nil {
return cfg, err
}
setStringFromEnvVal(&cfg.BaseEndpoint, []string{awsEndpointURL})
setStringFromEnvVal(&cfg.BaseEndpoint, []string{awsEndpointURLEnv})
if err := setBoolPtrFromEnvVal(&cfg.IgnoreConfiguredEndpoints, []string{awsIgnoreConfiguredEndpoints}); err != nil {
if err := setBoolPtrFromEnvVal(&cfg.IgnoreConfiguredEndpoints, []string{awsIgnoreConfiguredEndpointURLEnv}); err != nil {
return cfg, err
}
@@ -400,6 +413,15 @@ func NewEnvConfig() (EnvConfig, error) {
return cfg, err
}
if err := setRequestChecksumCalculationFromEnvVal(&cfg.RequestChecksumCalculation, []string{awsRequestChecksumCalculation}); err != nil {
return cfg, err
}
if err := setResponseChecksumValidationFromEnvVal(&cfg.ResponseChecksumValidation, []string{awsResponseChecksumValidation}); err != nil {
return cfg, err
}
cfg.AuthSchemePreference = toAuthSchemePreferenceList(os.Getenv(awsAuthSchemePreferenceEnv))
return cfg, nil
}
@@ -432,6 +454,14 @@ func (c EnvConfig) getAccountIDEndpointMode(context.Context) (aws.AccountIDEndpo
return c.AccountIDEndpointMode, len(c.AccountIDEndpointMode) > 0, nil
}
func (c EnvConfig) getRequestChecksumCalculation(context.Context) (aws.RequestChecksumCalculation, bool, error) {
return c.RequestChecksumCalculation, c.RequestChecksumCalculation > 0, nil
}
func (c EnvConfig) getResponseChecksumValidation(context.Context) (aws.ResponseChecksumValidation, bool, error) {
return c.ResponseChecksumValidation, c.ResponseChecksumValidation > 0, nil
}
// GetRetryMaxAttempts returns the value of AWS_MAX_ATTEMPTS if was specified,
// and not 0.
func (c EnvConfig) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) {
@@ -528,6 +558,45 @@ func setAIDEndPointModeFromEnvVal(m *aws.AccountIDEndpointMode, keys []string) e
return nil
}
func setRequestChecksumCalculationFromEnvVal(m *aws.RequestChecksumCalculation, keys []string) error {
for _, k := range keys {
value := os.Getenv(k)
if len(value) == 0 {
continue
}
switch strings.ToLower(value) {
case checksumWhenSupported:
*m = aws.RequestChecksumCalculationWhenSupported
case checksumWhenRequired:
*m = aws.RequestChecksumCalculationWhenRequired
default:
return fmt.Errorf("invalid value for environment variable, %s=%s, must be when_supported/when_required", k, value)
}
}
return nil
}
func setResponseChecksumValidationFromEnvVal(m *aws.ResponseChecksumValidation, keys []string) error {
for _, k := range keys {
value := os.Getenv(k)
if len(value) == 0 {
continue
}
switch strings.ToLower(value) {
case checksumWhenSupported:
*m = aws.ResponseChecksumValidationWhenSupported
case checksumWhenRequired:
*m = aws.ResponseChecksumValidationWhenRequired
default:
return fmt.Errorf("invalid value for environment variable, %s=%s, must be when_supported/when_required", k, value)
}
}
return nil
}
// GetRegion returns the AWS Region if set in the environment. Returns an empty
// string if not set.
func (c EnvConfig) getRegion(ctx context.Context) (string, bool, error) {
@@ -584,7 +653,7 @@ func (c EnvConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) {
return nil, false, nil
}
b, err := ioutil.ReadFile(c.CustomCABundle)
b, err := os.ReadFile(c.CustomCABundle)
if err != nil {
return nil, false, err
}
@@ -608,7 +677,7 @@ func (c EnvConfig) getBaseEndpoint(context.Context) (string, bool, error) {
// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use
// with configured endpoints.
func (c EnvConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) {
if endpt := os.Getenv(fmt.Sprintf("%s_%s", awsEndpointURL, normalizeEnv(sdkID))); endpt != "" {
if endpt := os.Getenv(fmt.Sprintf("%s_%s", awsEndpointURLEnv, normalizeEnv(sdkID))); endpt != "" {
return endpt, true, nil
}
return "", false, nil
@@ -854,3 +923,10 @@ func (c EnvConfig) GetS3DisableExpressAuth() (value, ok bool) {
return *c.S3DisableExpressAuth, true
}
func (c EnvConfig) getAuthSchemePreference() ([]string, bool) {
if len(c.AuthSchemePreference) > 0 {
return c.AuthSchemePreference, true
}
return nil, false
}

View File

@@ -3,4 +3,4 @@
package config
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.27.27"
const goModuleVersion = "1.31.15"

View File

@@ -14,6 +14,7 @@ import (
smithybearer "github.com/aws/smithy-go/auth/bearer"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// LoadOptionsFunc is a type alias for LoadOptions functional option
@@ -216,7 +217,29 @@ type LoadOptions struct {
// Whether S3 Express auth is disabled.
S3DisableExpressAuth *bool
// Whether account id should be built into endpoint resolution
AccountIDEndpointMode aws.AccountIDEndpointMode
// Specify if request checksum should be calculated
RequestChecksumCalculation aws.RequestChecksumCalculation
// Specifies if response checksum should be validated
ResponseChecksumValidation aws.ResponseChecksumValidation
// Service endpoint override. This value is not necessarily final and is
// passed to the service's EndpointResolverV2 for further delegation.
BaseEndpoint string
// Registry of operation interceptors.
Interceptors smithyhttp.InterceptorRegistry
// Priority list of preferred auth scheme names (e.g. sigv4a).
AuthSchemePreference []string
// ServiceOptions provides service specific configuration options that will be applied
// when constructing clients for specific services. Each callback function receives the service ID
// and the service's Options struct, allowing for dynamic configuration based on the service.
ServiceOptions []func(string, any)
}
func (o LoadOptions) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) {
@@ -284,6 +307,31 @@ func (o LoadOptions) getAccountIDEndpointMode(ctx context.Context) (aws.AccountI
return o.AccountIDEndpointMode, len(o.AccountIDEndpointMode) > 0, nil
}
func (o LoadOptions) getRequestChecksumCalculation(ctx context.Context) (aws.RequestChecksumCalculation, bool, error) {
return o.RequestChecksumCalculation, o.RequestChecksumCalculation > 0, nil
}
func (o LoadOptions) getResponseChecksumValidation(ctx context.Context) (aws.ResponseChecksumValidation, bool, error) {
return o.ResponseChecksumValidation, o.ResponseChecksumValidation > 0, nil
}
func (o LoadOptions) getBaseEndpoint(context.Context) (string, bool, error) {
return o.BaseEndpoint, o.BaseEndpoint != "", nil
}
func (o LoadOptions) getServiceOptions(context.Context) ([]func(string, any), bool, error) {
return o.ServiceOptions, len(o.ServiceOptions) > 0, nil
}
// GetServiceBaseEndpoint satisfies (internal/configsources).ServiceBaseEndpointProvider.
//
// The sdkID value is unused because LoadOptions only supports setting a GLOBAL
// endpoint override. In-code, per-service endpoint overrides are performed via
// functional options in service client space.
func (o LoadOptions) GetServiceBaseEndpoint(context.Context, string) (string, bool, error) {
return o.BaseEndpoint, o.BaseEndpoint != "", nil
}
// WithRegion is a helper function to construct functional options
// that sets Region on config's LoadOptions. Setting the region to
// an empty string, will result in the region value being ignored.
@@ -340,6 +388,26 @@ func WithAccountIDEndpointMode(m aws.AccountIDEndpointMode) LoadOptionsFunc {
}
}
// WithRequestChecksumCalculation is a helper function to construct functional options
// that sets RequestChecksumCalculation on config's LoadOptions
func WithRequestChecksumCalculation(c aws.RequestChecksumCalculation) LoadOptionsFunc {
return func(o *LoadOptions) error {
if c > 0 {
o.RequestChecksumCalculation = c
}
return nil
}
}
// WithResponseChecksumValidation is a helper function to construct functional options
// that sets ResponseChecksumValidation on config's LoadOptions
func WithResponseChecksumValidation(v aws.ResponseChecksumValidation) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.ResponseChecksumValidation = v
return nil
}
}
// getDefaultRegion returns DefaultRegion from config's LoadOptions
func (o LoadOptions) getDefaultRegion(ctx context.Context) (string, bool, error) {
if len(o.DefaultRegion) == 0 {
@@ -1139,3 +1207,149 @@ func WithS3DisableExpressAuth(v bool) LoadOptionsFunc {
return nil
}
}
// WithBaseEndpoint is a helper function to construct functional options that
// sets BaseEndpoint on config's LoadOptions. Empty values have no effect, and
// subsequent calls to this API override previous ones.
//
// This is an in-code setting, therefore, any value set using this hook takes
// precedence over and will override ALL environment and shared config
// directives that set endpoint URLs. Functional options on service clients
// have higher specificity, and functional options that modify the value of
// BaseEndpoint on a client will take precedence over this setting.
func WithBaseEndpoint(v string) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.BaseEndpoint = v
return nil
}
}
// WithServiceOptions is a helper function to construct functional options
// that sets ServiceOptions on config's LoadOptions.
func WithServiceOptions(callbacks ...func(string, any)) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.ServiceOptions = append(o.ServiceOptions, callbacks...)
return nil
}
}
// WithBeforeExecution adds the BeforeExecutionInterceptor to config.
func WithBeforeExecution(i smithyhttp.BeforeExecutionInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.BeforeExecution = append(o.Interceptors.BeforeExecution, i)
return nil
}
}
// WithBeforeSerialization adds the BeforeSerializationInterceptor to config.
func WithBeforeSerialization(i smithyhttp.BeforeSerializationInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.BeforeSerialization = append(o.Interceptors.BeforeSerialization, i)
return nil
}
}
// WithAfterSerialization adds the AfterSerializationInterceptor to config.
func WithAfterSerialization(i smithyhttp.AfterSerializationInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.AfterSerialization = append(o.Interceptors.AfterSerialization, i)
return nil
}
}
// WithBeforeRetryLoop adds the BeforeRetryLoopInterceptor to config.
func WithBeforeRetryLoop(i smithyhttp.BeforeRetryLoopInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.BeforeRetryLoop = append(o.Interceptors.BeforeRetryLoop, i)
return nil
}
}
// WithBeforeAttempt adds the BeforeAttemptInterceptor to config.
func WithBeforeAttempt(i smithyhttp.BeforeAttemptInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.BeforeAttempt = append(o.Interceptors.BeforeAttempt, i)
return nil
}
}
// WithBeforeSigning adds the BeforeSigningInterceptor to config.
func WithBeforeSigning(i smithyhttp.BeforeSigningInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.BeforeSigning = append(o.Interceptors.BeforeSigning, i)
return nil
}
}
// WithAfterSigning adds the AfterSigningInterceptor to config.
func WithAfterSigning(i smithyhttp.AfterSigningInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.AfterSigning = append(o.Interceptors.AfterSigning, i)
return nil
}
}
// WithBeforeTransmit adds the BeforeTransmitInterceptor to config.
func WithBeforeTransmit(i smithyhttp.BeforeTransmitInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.BeforeTransmit = append(o.Interceptors.BeforeTransmit, i)
return nil
}
}
// WithAfterTransmit adds the AfterTransmitInterceptor to config.
func WithAfterTransmit(i smithyhttp.AfterTransmitInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.AfterTransmit = append(o.Interceptors.AfterTransmit, i)
return nil
}
}
// WithBeforeDeserialization adds the BeforeDeserializationInterceptor to config.
func WithBeforeDeserialization(i smithyhttp.BeforeDeserializationInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.BeforeDeserialization = append(o.Interceptors.BeforeDeserialization, i)
return nil
}
}
// WithAfterDeserialization adds the AfterDeserializationInterceptor to config.
func WithAfterDeserialization(i smithyhttp.AfterDeserializationInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.AfterDeserialization = append(o.Interceptors.AfterDeserialization, i)
return nil
}
}
// WithAfterAttempt adds the AfterAttemptInterceptor to config.
func WithAfterAttempt(i smithyhttp.AfterAttemptInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.AfterAttempt = append(o.Interceptors.AfterAttempt, i)
return nil
}
}
// WithAfterExecution adds the AfterExecutionInterceptor to config.
func WithAfterExecution(i smithyhttp.AfterExecutionInterceptor) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.Interceptors.AfterExecution = append(o.Interceptors.AfterExecution, i)
return nil
}
}
// WithAuthSchemePreference sets the priority order of auth schemes on config.
//
// Schemes are expressed as names e.g. sigv4a or sigv4.
func WithAuthSchemePreference(schemeIDs ...string) LoadOptionsFunc {
return func(o *LoadOptions) error {
o.AuthSchemePreference = schemeIDs
return nil
}
}
func (o LoadOptions) getAuthSchemePreference() ([]string, bool) {
if len(o.AuthSchemePreference) > 0 {
return o.AuthSchemePreference, true
}
return nil, false
}

View File

@@ -242,6 +242,40 @@ func getAccountIDEndpointMode(ctx context.Context, configs configs) (value aws.A
return
}
// requestChecksumCalculationProvider provides access to the RequestChecksumCalculation
type requestChecksumCalculationProvider interface {
getRequestChecksumCalculation(context.Context) (aws.RequestChecksumCalculation, bool, error)
}
func getRequestChecksumCalculation(ctx context.Context, configs configs) (value aws.RequestChecksumCalculation, found bool, err error) {
for _, cfg := range configs {
if p, ok := cfg.(requestChecksumCalculationProvider); ok {
value, found, err = p.getRequestChecksumCalculation(ctx)
if err != nil || found {
break
}
}
}
return
}
// responseChecksumValidationProvider provides access to the ResponseChecksumValidation
type responseChecksumValidationProvider interface {
getResponseChecksumValidation(context.Context) (aws.ResponseChecksumValidation, bool, error)
}
func getResponseChecksumValidation(ctx context.Context, configs configs) (value aws.ResponseChecksumValidation, found bool, err error) {
for _, cfg := range configs {
if p, ok := cfg.(responseChecksumValidationProvider); ok {
value, found, err = p.getResponseChecksumValidation(ctx)
if err != nil || found {
break
}
}
}
return
}
// ec2IMDSRegionProvider provides access to the ec2 imds region
// configuration value
type ec2IMDSRegionProvider interface {
@@ -719,3 +753,34 @@ func getRetryMode(ctx context.Context, configs configs) (v aws.RetryMode, found
}
return v, found, err
}
func getAuthSchemePreference(ctx context.Context, configs configs) ([]string, bool) {
type provider interface {
getAuthSchemePreference() ([]string, bool)
}
for _, cfg := range configs {
if p, ok := cfg.(provider); ok {
if v, ok := p.getAuthSchemePreference(); ok {
return v, true
}
}
}
return nil, false
}
type serviceOptionsProvider interface {
getServiceOptions(ctx context.Context) ([]func(string, any), bool, error)
}
func getServiceOptions(ctx context.Context, configs configs) (v []func(string, any), found bool, err error) {
for _, c := range configs {
if p, ok := c.(serviceOptionsProvider); ok {
v, found, err = p.getServiceOptions(ctx)
if err != nil || found {
break
}
}
}
return v, found, err
}

View File

@@ -182,6 +182,36 @@ func resolveAccountIDEndpointMode(ctx context.Context, cfg *aws.Config, configs
return nil
}
// resolveRequestChecksumCalculation extracts the RequestChecksumCalculation from the configs slice's
// SharedConfig or EnvConfig
func resolveRequestChecksumCalculation(ctx context.Context, cfg *aws.Config, configs configs) error {
c, found, err := getRequestChecksumCalculation(ctx, configs)
if err != nil {
return err
}
if !found {
c = aws.RequestChecksumCalculationWhenSupported
}
cfg.RequestChecksumCalculation = c
return nil
}
// resolveResponseValidation extracts the ResponseChecksumValidation from the configs slice's
// SharedConfig or EnvConfig
func resolveResponseChecksumValidation(ctx context.Context, cfg *aws.Config, configs configs) error {
c, found, err := getResponseChecksumValidation(ctx, configs)
if err != nil {
return err
}
if !found {
c = aws.ResponseChecksumValidationWhenSupported
}
cfg.ResponseChecksumValidation = c
return nil
}
// resolveDefaultRegion extracts the first instance of a default region and sets `aws.Config.Region` to the default
// region if region had not been resolved from other sources.
func resolveDefaultRegion(ctx context.Context, cfg *aws.Config, configs configs) error {
@@ -381,3 +411,34 @@ func resolveRetryMode(ctx context.Context, cfg *aws.Config, configs configs) err
return nil
}
func resolveInterceptors(ctx context.Context, cfg *aws.Config, configs configs) error {
// LoadOptions is the only thing that you can really configure interceptors
// on so just check that directly.
for _, c := range configs {
if loadopts, ok := c.(LoadOptions); ok {
cfg.Interceptors = loadopts.Interceptors.Copy()
}
}
return nil
}
func resolveAuthSchemePreference(ctx context.Context, cfg *aws.Config, configs configs) error {
if pref, ok := getAuthSchemePreference(ctx, configs); ok {
cfg.AuthSchemePreference = pref
}
return nil
}
func resolveServiceOptions(ctx context.Context, cfg *aws.Config, configs configs) error {
serviceOptions, found, err := getServiceOptions(ctx, configs)
if err != nil {
return err
}
if !found {
return nil
}
cfg.ServiceOptions = serviceOptions
return nil
}

View File

@@ -112,13 +112,15 @@ func resolveCredentialChain(ctx context.Context, cfg *aws.Config, configs config
switch {
case sharedProfileSet:
err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other)
ctx, err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other)
case envConfig.Credentials.HasKeys():
cfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials}
ctx = addCredentialSource(ctx, aws.CredentialSourceEnvVars)
cfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials, Source: getCredentialSources(ctx)}
case len(envConfig.WebIdentityTokenFilePath) > 0:
ctx = addCredentialSource(ctx, aws.CredentialSourceEnvVarsSTSWebIDToken)
err = assumeWebIdentity(ctx, cfg, envConfig.WebIdentityTokenFilePath, envConfig.RoleARN, envConfig.RoleSessionName, configs)
default:
err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other)
ctx, err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other)
}
if err != nil {
return err
@@ -133,53 +135,71 @@ func resolveCredentialChain(ctx context.Context, cfg *aws.Config, configs config
return nil
}
func resolveCredsFromProfile(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedConfig *SharedConfig, configs configs) (err error) {
func resolveCredsFromProfile(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedConfig *SharedConfig, configs configs) (ctx2 context.Context, err error) {
switch {
case sharedConfig.Source != nil:
ctx = addCredentialSource(ctx, aws.CredentialSourceProfileSourceProfile)
// Assume IAM role with credentials source from a different profile.
err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig.Source, configs)
ctx, err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig.Source, configs)
case sharedConfig.Credentials.HasKeys():
// Static Credentials from Shared Config/Credentials file.
ctx = addCredentialSource(ctx, aws.CredentialSourceProfile)
cfg.Credentials = credentials.StaticCredentialsProvider{
Value: sharedConfig.Credentials,
Value: sharedConfig.Credentials,
Source: getCredentialSources(ctx),
}
case len(sharedConfig.CredentialSource) != 0:
err = resolveCredsFromSource(ctx, cfg, envConfig, sharedConfig, configs)
ctx = addCredentialSource(ctx, aws.CredentialSourceProfileNamedProvider)
ctx, err = resolveCredsFromSource(ctx, cfg, envConfig, sharedConfig, configs)
case len(sharedConfig.WebIdentityTokenFile) != 0:
// Credentials from Assume Web Identity token require an IAM Role, and
// that roll will be assumed. May be wrapped with another assume role
// via SourceProfile.
return assumeWebIdentity(ctx, cfg, sharedConfig.WebIdentityTokenFile, sharedConfig.RoleARN, sharedConfig.RoleSessionName, configs)
ctx = addCredentialSource(ctx, aws.CredentialSourceProfileSTSWebIDToken)
return ctx, assumeWebIdentity(ctx, cfg, sharedConfig.WebIdentityTokenFile, sharedConfig.RoleARN, sharedConfig.RoleSessionName, configs)
case sharedConfig.hasSSOConfiguration():
if sharedConfig.hasLegacySSOConfiguration() {
ctx = addCredentialSource(ctx, aws.CredentialSourceProfileSSOLegacy)
ctx = addCredentialSource(ctx, aws.CredentialSourceSSOLegacy)
} else {
ctx = addCredentialSource(ctx, aws.CredentialSourceSSO)
}
if sharedConfig.SSOSession != nil {
ctx = addCredentialSource(ctx, aws.CredentialSourceProfileSSO)
}
err = resolveSSOCredentials(ctx, cfg, sharedConfig, configs)
case len(sharedConfig.CredentialProcess) != 0:
// Get credentials from CredentialProcess
ctx = addCredentialSource(ctx, aws.CredentialSourceProfileProcess)
ctx = addCredentialSource(ctx, aws.CredentialSourceProcess)
err = processCredentials(ctx, cfg, sharedConfig, configs)
case len(envConfig.ContainerCredentialsEndpoint) != 0:
err = resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs)
case len(envConfig.ContainerCredentialsRelativePath) != 0:
ctx = addCredentialSource(ctx, aws.CredentialSourceHTTP)
err = resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs)
case len(envConfig.ContainerCredentialsEndpoint) != 0:
ctx = addCredentialSource(ctx, aws.CredentialSourceHTTP)
err = resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs)
default:
ctx = addCredentialSource(ctx, aws.CredentialSourceIMDS)
err = resolveEC2RoleCredentials(ctx, cfg, configs)
}
if err != nil {
return err
return ctx, err
}
if len(sharedConfig.RoleARN) > 0 {
return credsFromAssumeRole(ctx, cfg, sharedConfig, configs)
return ctx, credsFromAssumeRole(ctx, cfg, sharedConfig, configs)
}
return nil
return ctx, nil
}
func resolveSSOCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *SharedConfig, configs configs) error {
@@ -198,6 +218,10 @@ func resolveSSOCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *S
cfgCopy := cfg.Copy()
options = append(options, func(o *ssocreds.Options) {
o.CredentialSources = getCredentialSources(ctx)
})
if sharedConfig.SSOSession != nil {
ssoTokenProviderOptionsFn, found, err := getSSOTokenProviderOptions(ctx, configs)
if err != nil {
@@ -242,6 +266,10 @@ func processCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *Shar
opts = append(opts, options)
}
opts = append(opts, func(o *processcreds.Options) {
o.CredentialSources = getCredentialSources(ctx)
})
cfg.Credentials = processcreds.NewProvider(sharedConfig.CredentialProcess, opts...)
return nil
@@ -323,6 +351,7 @@ func resolveHTTPCredProvider(ctx context.Context, cfg *aws.Config, url, authToke
if cfg.Retryer != nil {
options.Retryer = cfg.Retryer()
}
options.CredentialSources = getCredentialSources(ctx)
},
}
@@ -346,25 +375,31 @@ func resolveHTTPCredProvider(ctx context.Context, cfg *aws.Config, url, authToke
return nil
}
func resolveCredsFromSource(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedCfg *SharedConfig, configs configs) (err error) {
func resolveCredsFromSource(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedCfg *SharedConfig, configs configs) (context.Context, error) {
switch sharedCfg.CredentialSource {
case credSourceEc2Metadata:
return resolveEC2RoleCredentials(ctx, cfg, configs)
ctx = addCredentialSource(ctx, aws.CredentialSourceIMDS)
return ctx, resolveEC2RoleCredentials(ctx, cfg, configs)
case credSourceEnvironment:
cfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials}
ctx = addCredentialSource(ctx, aws.CredentialSourceHTTP)
cfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials, Source: getCredentialSources(ctx)}
case credSourceECSContainer:
if len(envConfig.ContainerCredentialsRelativePath) == 0 {
return fmt.Errorf("EcsContainer was specified as the credential_source, but 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' was not set")
ctx = addCredentialSource(ctx, aws.CredentialSourceHTTP)
if len(envConfig.ContainerCredentialsRelativePath) != 0 {
return ctx, resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs)
}
return resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs)
if len(envConfig.ContainerCredentialsEndpoint) != 0 {
return ctx, resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs)
}
return ctx, fmt.Errorf("EcsContainer was specified as the credential_source, but neither 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' or AWS_CONTAINER_CREDENTIALS_FULL_URI' was set")
default:
return fmt.Errorf("credential_source values must be EcsContainer, Ec2InstanceMetadata, or Environment")
return ctx, fmt.Errorf("credential_source values must be EcsContainer, Ec2InstanceMetadata, or Environment")
}
return nil
return ctx, nil
}
func resolveEC2RoleCredentials(ctx context.Context, cfg *aws.Config, configs configs) error {
@@ -383,6 +418,7 @@ func resolveEC2RoleCredentials(ctx context.Context, cfg *aws.Config, configs con
if o.Client == nil {
o.Client = imds.NewFromConfig(*cfg)
}
o.CredentialSources = getCredentialSources(ctx)
})
provider := ec2rolecreds.New(optFns...)
@@ -391,7 +427,6 @@ func resolveEC2RoleCredentials(ctx context.Context, cfg *aws.Config, configs con
if err != nil {
return err
}
return nil
}
@@ -470,6 +505,10 @@ func assumeWebIdentity(ctx context.Context, cfg *aws.Config, filepath string, ro
RoleARN: roleARN,
}
optFns = append(optFns, func(options *stscreds.WebIdentityRoleOptions) {
options.CredentialSources = getCredentialSources(ctx)
})
for _, fn := range optFns {
fn(&opts)
}
@@ -491,6 +530,8 @@ func assumeWebIdentity(ctx context.Context, cfg *aws.Config, filepath string, ro
}
func credsFromAssumeRole(ctx context.Context, cfg *aws.Config, sharedCfg *SharedConfig, configs configs) (err error) {
// resolve credentials early
credentialSources := getCredentialSources(ctx)
optFns := []func(*stscreds.AssumeRoleOptions){
func(options *stscreds.AssumeRoleOptions) {
options.RoleSessionName = sharedCfg.RoleSessionName
@@ -508,6 +549,9 @@ func credsFromAssumeRole(ctx context.Context, cfg *aws.Config, sharedCfg *Shared
if len(sharedCfg.MFASerial) != 0 {
options.SerialNumber = aws.String(sharedCfg.MFASerial)
}
// add existing credential chain
options.CredentialSources = credentialSources
},
}
@@ -530,7 +574,6 @@ func credsFromAssumeRole(ctx context.Context, cfg *aws.Config, sharedCfg *Shared
return AssumeRoleTokenProviderNotSetError{}
}
}
cfg.Credentials = stscreds.NewAssumeRoleProvider(sts.NewFromConfig(*cfg), sharedCfg.RoleARN, optFns...)
return nil
@@ -564,3 +607,21 @@ func wrapWithCredentialsCache(
return aws.NewCredentialsCache(provider, optFns...), nil
}
// credentialSource stores the chain of providers that was used to create an instance of
// a credentials provider on the context
type credentialSource struct{}
func addCredentialSource(ctx context.Context, source aws.CredentialSource) context.Context {
existing, ok := ctx.Value(credentialSource{}).([]aws.CredentialSource)
if !ok {
existing = []aws.CredentialSource{source}
} else {
existing = append(existing, source)
}
return context.WithValue(ctx, credentialSource{}, existing)
}
func getCredentialSources(ctx context.Context) []aws.CredentialSource {
return ctx.Value(credentialSource{}).([]aws.CredentialSource)
}

View File

@@ -118,6 +118,13 @@ const (
accountIDKey = "aws_account_id"
accountIDEndpointMode = "account_id_endpoint_mode"
requestChecksumCalculationKey = "request_checksum_calculation"
responseChecksumValidationKey = "response_checksum_validation"
checksumWhenSupported = "when_supported"
checksumWhenRequired = "when_required"
authSchemePreferenceKey = "auth_scheme_preference"
)
// defaultSharedConfigProfile allows for swapping the default profile for testing
@@ -346,6 +353,15 @@ type SharedConfig struct {
S3DisableExpressAuth *bool
AccountIDEndpointMode aws.AccountIDEndpointMode
// RequestChecksumCalculation indicates if the request checksum should be calculated
RequestChecksumCalculation aws.RequestChecksumCalculation
// ResponseChecksumValidation indicates if the response checksum should be validated
ResponseChecksumValidation aws.ResponseChecksumValidation
// Priority list of preferred auth scheme names (e.g. sigv4a).
AuthSchemePreference []string
}
func (c SharedConfig) getDefaultsMode(ctx context.Context) (value aws.DefaultsMode, ok bool, err error) {
@@ -879,6 +895,8 @@ func mergeSections(dst *ini.Sections, src ini.Sections) error {
ssoRegionKey,
ssoRoleNameKey,
ssoStartURLKey,
authSchemePreferenceKey,
}
for i := range stringKeys {
if err := mergeStringKey(&srcSection, &dstSection, sectionName, stringKeys[i]); err != nil {
@@ -1133,6 +1151,13 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er
return fmt.Errorf("failed to load %s from shared config, %w", accountIDEndpointMode, err)
}
if err := updateRequestChecksumCalculation(&c.RequestChecksumCalculation, section, requestChecksumCalculationKey); err != nil {
return fmt.Errorf("failed to load %s from shared config, %w", requestChecksumCalculationKey, err)
}
if err := updateResponseChecksumValidation(&c.ResponseChecksumValidation, section, responseChecksumValidationKey); err != nil {
return fmt.Errorf("failed to load %s from shared config, %w", responseChecksumValidationKey, err)
}
// Shared Credentials
creds := aws.Credentials{
AccessKeyID: section.String(accessKeyIDKey),
@@ -1148,6 +1173,8 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er
updateString(&c.ServicesSectionName, section, servicesSectionKey)
c.AuthSchemePreference = toAuthSchemePreferenceList(section.String(authSchemePreferenceKey))
return nil
}
@@ -1207,6 +1234,42 @@ func updateAIDEndpointMode(m *aws.AccountIDEndpointMode, sec ini.Section, key st
return nil
}
func updateRequestChecksumCalculation(m *aws.RequestChecksumCalculation, sec ini.Section, key string) error {
if !sec.Has(key) {
return nil
}
v := sec.String(key)
switch strings.ToLower(v) {
case checksumWhenSupported:
*m = aws.RequestChecksumCalculationWhenSupported
case checksumWhenRequired:
*m = aws.RequestChecksumCalculationWhenRequired
default:
return fmt.Errorf("invalid value for shared config profile field, %s=%s, must be when_supported/when_required", key, v)
}
return nil
}
func updateResponseChecksumValidation(m *aws.ResponseChecksumValidation, sec ini.Section, key string) error {
if !sec.Has(key) {
return nil
}
v := sec.String(key)
switch strings.ToLower(v) {
case checksumWhenSupported:
*m = aws.ResponseChecksumValidationWhenSupported
case checksumWhenRequired:
*m = aws.ResponseChecksumValidationWhenRequired
default:
return fmt.Errorf("invalid value for shared config profile field, %s=%s, must be when_supported/when_required", key, v)
}
return nil
}
func (c SharedConfig) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) {
if c.RequestMinCompressSizeBytes == nil {
return 0, false, nil
@@ -1225,6 +1288,14 @@ func (c SharedConfig) getAccountIDEndpointMode(ctx context.Context) (aws.Account
return c.AccountIDEndpointMode, len(c.AccountIDEndpointMode) > 0, nil
}
func (c SharedConfig) getRequestChecksumCalculation(ctx context.Context) (aws.RequestChecksumCalculation, bool, error) {
return c.RequestChecksumCalculation, c.RequestChecksumCalculation > 0, nil
}
func (c SharedConfig) getResponseChecksumValidation(ctx context.Context) (aws.ResponseChecksumValidation, bool, error) {
return c.ResponseChecksumValidation, c.ResponseChecksumValidation > 0, nil
}
func updateDefaultsMode(mode *aws.DefaultsMode, section ini.Section, key string) error {
if !section.Has(key) {
return nil
@@ -1616,3 +1687,10 @@ func updateUseFIPSEndpoint(dst *aws.FIPSEndpointState, section ini.Section, key
return
}
func (c SharedConfig) getAuthSchemePreference() ([]string, bool) {
if len(c.AuthSchemePreference) > 0 {
return c.AuthSchemePreference, true
}
return nil, false
}

View File

@@ -1,3 +1,268 @@
# v1.18.19 (2025-10-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.18 (2025-10-22)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.17 (2025-10-16)
* **Dependency Update**: Bump minimum Go version to 1.23.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.16 (2025-09-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.15 (2025-09-26)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.14 (2025-09-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.13 (2025-09-22)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.12 (2025-09-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.11 (2025-09-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.10 (2025-08-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.9 (2025-08-28)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.8 (2025-08-27)
* **Dependency Update**: Update to smithy-go v1.23.0.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.7 (2025-08-26)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.6 (2025-08-21)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.5 (2025-08-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.4 (2025-08-11)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.3 (2025-08-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.2 (2025-07-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.1 (2025-07-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.0 (2025-07-28)
* **Feature**: Add support for HTTP interceptors.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.71 (2025-07-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.70 (2025-06-17)
* **Dependency Update**: Update to smithy-go v1.22.4.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.69 (2025-06-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.68 (2025-06-06)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.67 (2025-04-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.66 (2025-04-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.65 (2025-03-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.64 (2025-03-25)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.63 (2025-03-24)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.62 (2025-03-04.2)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.61 (2025-02-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.60 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.59 (2025-02-05)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.58 (2025-02-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.57 (2025-01-31)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.56 (2025-01-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.55 (2025-01-24)
* **Dependency Update**: Updated to the latest SDK module versions
* **Dependency Update**: Upgrade to smithy-go v1.22.2.
# v1.17.54 (2025-01-17)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.53 (2025-01-15)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.52 (2025-01-14)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.51 (2025-01-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.50 (2025-01-09)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.49 (2025-01-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.48 (2024-12-19)
* **Bug Fix**: Fix improper use of printf-style functions.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.47 (2024-12-02)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.46 (2024-11-18)
* **Dependency Update**: Update to smithy-go v1.22.1.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.45 (2024-11-14)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.44 (2024-11-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.43 (2024-11-06)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.42 (2024-10-28)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.41 (2024-10-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.40 (2024-10-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.39 (2024-10-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.38 (2024-10-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.37 (2024-09-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.36 (2024-09-25)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.35 (2024-09-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.34 (2024-09-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.33 (2024-09-17)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.32 (2024-09-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.31 (2024-09-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.30 (2024-08-26)
* **Bug Fix**: Save SSO cached token expiry in UTC to ensure cross-SDK compatibility.
# v1.17.29 (2024-08-22)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.28 (2024-08-15)
* **Dependency Update**: Bump minimum Go version to 1.21.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.17.27 (2024-07-18)
* **Dependency Update**: Updated to the latest SDK module versions

View File

@@ -47,6 +47,10 @@ type Options struct {
//
// If nil, the provider will default to the EC2 IMDS client.
Client GetMetadataAPIClient
// The chain of providers that was used to create this provider
// These values are for reporting purposes and are not meant to be set up directly
CredentialSources []aws.CredentialSource
}
// New returns an initialized Provider value configured to retrieve
@@ -227,3 +231,11 @@ func requestCred(ctx context.Context, client GetMetadataAPIClient, credsName str
return respCreds, nil
}
// ProviderSources returns the credential chain that was used to construct this provider
func (p *Provider) ProviderSources() []aws.CredentialSource {
if p.options.CredentialSources == nil {
return []aws.CredentialSource{aws.CredentialSourceIMDS}
} // If no source has been set, assume this is used directly which means just call to assume role
return p.options.CredentialSources
}

View File

@@ -98,6 +98,10 @@ type Options struct {
//
// Will override AuthorizationToken if configured
AuthorizationTokenProvider AuthTokenProvider
// The chain of providers that was used to create this provider
// These values are for reporting purposes and are not meant to be set up directly
CredentialSources []aws.CredentialSource
}
// AuthTokenProvider defines an interface to dynamically load a value to be passed
@@ -191,3 +195,13 @@ func (p *Provider) resolveAuthToken() (string, error) {
return authToken, nil
}
var _ aws.CredentialProviderSource = (*Provider)(nil)
// ProviderSources returns the credential chain that was used to construct this provider
func (p *Provider) ProviderSources() []aws.CredentialSource {
if p.options.CredentialSources == nil {
return []aws.CredentialSource{aws.CredentialSourceHTTP}
}
return p.options.CredentialSources
}

View File

@@ -3,4 +3,4 @@
package credentials
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.17.27"
const goModuleVersion = "1.18.19"

View File

@@ -57,6 +57,9 @@ type Provider struct {
type Options struct {
// Timeout limits the time a process can run.
Timeout time.Duration
// The chain of providers that was used to create this provider
// These values are for reporting purposes and are not meant to be set up directly
CredentialSources []aws.CredentialSource
}
// NewCommandBuilder provides the interface for specifying how command will be
@@ -274,6 +277,14 @@ func (p *Provider) executeCredentialProcess(ctx context.Context) ([]byte, error)
return out, nil
}
// ProviderSources returns the credential chain that was used to construct this provider
func (p *Provider) ProviderSources() []aws.CredentialSource {
if p.options.CredentialSources == nil {
return []aws.CredentialSource{aws.CredentialSourceProcess}
}
return p.options.CredentialSources
}
func executeCommand(cmd *exec.Cmd, exec chan error) {
// Start the command
err := cmd.Start()

View File

@@ -225,7 +225,7 @@ func (r *rfc3339) UnmarshalJSON(bytes []byte) (err error) {
}
func (r *rfc3339) MarshalJSON() ([]byte, error) {
value := time.Time(*r).Format(time.RFC3339)
value := time.Time(*r).UTC().Format(time.RFC3339)
// Use JSON unmarshal to unescape the quoted value making use of JSON's
// quoting rules.

View File

@@ -49,6 +49,10 @@ type Options struct {
// Used by the SSOCredentialProvider if a token configuration
// profile is used in the shared config
SSOTokenProvider *SSOTokenProvider
// The chain of providers that was used to create this provider.
// These values are for reporting purposes and are not meant to be set up directly
CredentialSources []aws.CredentialSource
}
// Provider is an AWS credential provider that retrieves temporary AWS
@@ -133,6 +137,14 @@ func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) {
}, nil
}
// ProviderSources returns the credential chain that was used to construct this provider
func (p *Provider) ProviderSources() []aws.CredentialSource {
if p.options.CredentialSources == nil {
return []aws.CredentialSource{aws.CredentialSourceSSO}
}
return p.options.CredentialSources
}
// InvalidTokenError is the error type that is returned if loaded token has
// expired or is otherwise invalid. To refresh the SSO session run AWS SSO
// login with the corresponding profile.

View File

@@ -22,6 +22,16 @@ func (*StaticCredentialsEmptyError) Error() string {
// never expire.
type StaticCredentialsProvider struct {
Value aws.Credentials
// These values are for reporting purposes and are not meant to be set up directly
Source []aws.CredentialSource
}
// ProviderSources returns the credential chain that was used to construct this provider
func (s StaticCredentialsProvider) ProviderSources() []aws.CredentialSource {
if s.Source == nil {
return []aws.CredentialSource{aws.CredentialSourceCode} // If no source has been set, assume this is used directly which means hardcoded creds
}
return s.Source
}
// NewStaticCredentialsProvider return a StaticCredentialsProvider initialized with the AWS

View File

@@ -247,6 +247,10 @@ type AssumeRoleOptions struct {
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
// in the IAM User Guide. This parameter is optional.
TransitiveTagKeys []string
// The chain of providers that was used to create this provider
// These values are for reporting purposes and are not meant to be set up directly
CredentialSources []aws.CredentialSource
}
// NewAssumeRoleProvider constructs and returns a credentials provider that
@@ -324,3 +328,11 @@ func (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, err
AccountID: accountID,
}, nil
}
// ProviderSources returns the credential chain that was used to construct this provider
func (p *AssumeRoleProvider) ProviderSources() []aws.CredentialSource {
if p.options.CredentialSources == nil {
return []aws.CredentialSource{aws.CredentialSourceSTSAssumeRole}
} // If no source has been set, assume this is used directly which means just call to assume role
return append(p.options.CredentialSources, aws.CredentialSourceSTSAssumeRole)
}

View File

@@ -64,6 +64,10 @@ type WebIdentityRoleOptions struct {
// want to use as managed session policies. The policies must exist in the
// same account as the role.
PolicyARNs []types.PolicyDescriptorType
// The chain of providers that was used to create this provider
// These values are for reporting purposes and are not meant to be set up directly
CredentialSources []aws.CredentialSource
}
// IdentityTokenRetriever is an interface for retrieving a JWT
@@ -167,3 +171,11 @@ func getAccountID(u *types.AssumedRoleUser) string {
}
return parts[4]
}
// ProviderSources returns the credential chain that was used to construct this provider
func (p *WebIdentityRoleProvider) ProviderSources() []aws.CredentialSource {
if p.options.CredentialSources == nil {
return []aws.CredentialSource{aws.CredentialSourceSTSAssumeRoleWebID}
}
return p.options.CredentialSources
}

View File

@@ -1,3 +1,151 @@
# v1.18.11 (2025-10-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.10 (2025-10-16)
* **Dependency Update**: Bump minimum Go version to 1.23.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.9 (2025-09-26)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.8 (2025-09-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.7 (2025-09-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.6 (2025-08-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.5 (2025-08-27)
* **Dependency Update**: Update to smithy-go v1.23.0.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.4 (2025-08-21)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.3 (2025-08-11)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.2 (2025-08-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.1 (2025-07-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.18.0 (2025-07-29)
* **Feature**: Add config switch `DisableDefaultMaxBackoff` that allows you to disable the default maximum backoff (1 second) for IMDS calls retry attempt
# v1.17.0 (2025-07-28)
* **Feature**: Add support for HTTP interceptors.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.33 (2025-07-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.32 (2025-06-17)
* **Dependency Update**: Update to smithy-go v1.22.4.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.31 (2025-06-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.30 (2025-02-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.29 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.28 (2025-02-05)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.27 (2025-01-31)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.26 (2025-01-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.25 (2025-01-24)
* **Dependency Update**: Updated to the latest SDK module versions
* **Dependency Update**: Upgrade to smithy-go v1.22.2.
# v1.16.24 (2025-01-15)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.23 (2025-01-09)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.22 (2024-12-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.21 (2024-12-02)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.20 (2024-11-18)
* **Dependency Update**: Update to smithy-go v1.22.1.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.19 (2024-11-06)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.18 (2024-10-28)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.17 (2024-10-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.16 (2024-10-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.15 (2024-10-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.14 (2024-09-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.13 (2024-09-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.12 (2024-08-15)
* **Dependency Update**: Bump minimum Go version to 1.21.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.16.11 (2024-07-10.2)
* **Dependency Update**: Updated to the latest SDK module versions

View File

@@ -75,7 +75,9 @@ func New(options Options, optFns ...func(*Options)) *Client {
if options.Retryer == nil {
options.Retryer = retry.NewStandard()
}
options.Retryer = retry.AddWithMaxBackoffDelay(options.Retryer, 1*time.Second)
if !options.DisableDefaultMaxBackoff {
options.Retryer = retry.AddWithMaxBackoffDelay(options.Retryer, 1*time.Second)
}
if options.ClientEnableState == ClientDefaultEnableState {
if v := os.Getenv(disableClientEnvVar); strings.EqualFold(v, "true") {
@@ -189,6 +191,10 @@ type Options struct {
// can disable that behavior with this setting.
DisableDefaultTimeout bool
// By default all IMDS client operations enforce a 1-second retry delay at maximum.
// You can disable that behavior with this setting.
DisableDefaultMaxBackoff bool
// provides the caching of API tokens used for operation calls. If unset,
// the API token will not be retrieved for the operation.
tokenProvider *tokenProvider

View File

@@ -3,4 +3,4 @@
package imds
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.16.11"
const goModuleVersion = "1.18.11"

View File

@@ -1,3 +1,147 @@
# v1.4.11 (2025-10-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.10 (2025-10-16)
* **Dependency Update**: Bump minimum Go version to 1.23.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.9 (2025-09-26)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.8 (2025-09-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.7 (2025-09-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.6 (2025-08-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.5 (2025-08-27)
* **Dependency Update**: Update to smithy-go v1.23.0.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.4 (2025-08-21)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.3 (2025-08-11)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.2 (2025-08-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.1 (2025-07-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.4.0 (2025-07-28)
* **Feature**: Add support for HTTP interceptors.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.37 (2025-07-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.36 (2025-06-17)
* **Dependency Update**: Update to smithy-go v1.22.4.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.35 (2025-06-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.34 (2025-02-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.33 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.32 (2025-02-05)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.31 (2025-01-31)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.30 (2025-01-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.29 (2025-01-24)
* **Dependency Update**: Updated to the latest SDK module versions
* **Dependency Update**: Upgrade to smithy-go v1.22.2.
# v1.3.28 (2025-01-15)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.27 (2025-01-09)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.26 (2024-12-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.25 (2024-12-02)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.24 (2024-11-18)
* **Dependency Update**: Update to smithy-go v1.22.1.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.23 (2024-11-06)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.22 (2024-10-28)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.21 (2024-10-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.20 (2024-10-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.19 (2024-10-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.18 (2024-09-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.17 (2024-09-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.16 (2024-08-15)
* **Dependency Update**: Bump minimum Go version to 1.21.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.3.15 (2024-07-10.2)
* **Dependency Update**: Updated to the latest SDK module versions

View File

@@ -3,4 +3,4 @@
package configsources
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.3.15"
const goModuleVersion = "1.4.11"

View File

@@ -3,7 +3,8 @@
package awsrulesfn
// GetPartition returns an AWS [Partition] for the region provided. If the
// partition cannot be determined nil will be returned.
// partition cannot be determined then the default partition (AWS commercial)
// will be returned.
func GetPartition(region string) *PartitionConfig {
return getPartition(partitions, region)
}
@@ -11,7 +12,7 @@ func GetPartition(region string) *PartitionConfig {
var partitions = []Partition{
{
ID: "aws",
RegionRegex: "^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",
RegionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws",
DnsSuffix: "amazonaws.com",
@@ -35,6 +36,13 @@ var partitions = []Partition{
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"ap-east-2": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"ap-northeast-1": {
Name: nil,
DnsSuffix: nil,
@@ -98,6 +106,27 @@ var partitions = []Partition{
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"ap-southeast-5": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"ap-southeast-6": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"ap-southeast-7": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"aws-global": {
Name: nil,
DnsSuffix: nil,
@@ -196,6 +225,13 @@ var partitions = []Partition{
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"mx-central-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"sa-east-1": {
Name: nil,
DnsSuffix: nil,
@@ -268,6 +304,160 @@ var partitions = []Partition{
},
},
},
{
ID: "aws-eusc",
RegionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws-eusc",
DnsSuffix: "amazonaws.eu",
DualStackDnsSuffix: "api.amazonwebservices.eu",
SupportsFIPS: true,
SupportsDualStack: true,
ImplicitGlobalRegion: "eusc-de-east-1",
},
Regions: map[string]RegionOverrides{
"eusc-de-east-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
},
},
{
ID: "aws-iso",
RegionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws-iso",
DnsSuffix: "c2s.ic.gov",
DualStackDnsSuffix: "api.aws.ic.gov",
SupportsFIPS: true,
SupportsDualStack: true,
ImplicitGlobalRegion: "us-iso-east-1",
},
Regions: map[string]RegionOverrides{
"aws-iso-global": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"us-iso-east-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"us-iso-west-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
},
},
{
ID: "aws-iso-b",
RegionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws-iso-b",
DnsSuffix: "sc2s.sgov.gov",
DualStackDnsSuffix: "api.aws.scloud",
SupportsFIPS: true,
SupportsDualStack: true,
ImplicitGlobalRegion: "us-isob-east-1",
},
Regions: map[string]RegionOverrides{
"aws-iso-b-global": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"us-isob-east-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"us-isob-west-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
},
},
{
ID: "aws-iso-e",
RegionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws-iso-e",
DnsSuffix: "cloud.adc-e.uk",
DualStackDnsSuffix: "api.cloud-aws.adc-e.uk",
SupportsFIPS: true,
SupportsDualStack: true,
ImplicitGlobalRegion: "eu-isoe-west-1",
},
Regions: map[string]RegionOverrides{
"aws-iso-e-global": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"eu-isoe-west-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
},
},
{
ID: "aws-iso-f",
RegionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws-iso-f",
DnsSuffix: "csp.hci.ic.gov",
DualStackDnsSuffix: "api.aws.hci.ic.gov",
SupportsFIPS: true,
SupportsDualStack: true,
ImplicitGlobalRegion: "us-isof-south-1",
},
Regions: map[string]RegionOverrides{
"aws-iso-f-global": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"us-isof-east-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"us-isof-south-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
},
},
{
ID: "aws-us-gov",
RegionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
@@ -303,101 +493,4 @@ var partitions = []Partition{
},
},
},
{
ID: "aws-iso",
RegionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws-iso",
DnsSuffix: "c2s.ic.gov",
DualStackDnsSuffix: "c2s.ic.gov",
SupportsFIPS: true,
SupportsDualStack: false,
ImplicitGlobalRegion: "us-iso-east-1",
},
Regions: map[string]RegionOverrides{
"aws-iso-global": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"us-iso-east-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"us-iso-west-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
},
},
{
ID: "aws-iso-b",
RegionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws-iso-b",
DnsSuffix: "sc2s.sgov.gov",
DualStackDnsSuffix: "sc2s.sgov.gov",
SupportsFIPS: true,
SupportsDualStack: false,
ImplicitGlobalRegion: "us-isob-east-1",
},
Regions: map[string]RegionOverrides{
"aws-iso-b-global": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
"us-isob-east-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
},
},
{
ID: "aws-iso-e",
RegionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws-iso-e",
DnsSuffix: "cloud.adc-e.uk",
DualStackDnsSuffix: "cloud.adc-e.uk",
SupportsFIPS: true,
SupportsDualStack: false,
ImplicitGlobalRegion: "eu-isoe-west-1",
},
Regions: map[string]RegionOverrides{
"eu-isoe-west-1": {
Name: nil,
DnsSuffix: nil,
DualStackDnsSuffix: nil,
SupportsFIPS: nil,
SupportsDualStack: nil,
},
},
},
{
ID: "aws-iso-f",
RegionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
DefaultConfig: PartitionConfig{
Name: "aws-iso-f",
DnsSuffix: "csp.hci.ic.gov",
DualStackDnsSuffix: "csp.hci.ic.gov",
SupportsFIPS: true,
SupportsDualStack: false,
ImplicitGlobalRegion: "us-isof-south-1",
},
Regions: map[string]RegionOverrides{},
},
}

View File

@@ -9,7 +9,7 @@
"supportsDualStack" : true,
"supportsFIPS" : true
},
"regionRegex" : "^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",
"regionRegex" : "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
"regions" : {
"af-south-1" : {
"description" : "Africa (Cape Town)"
@@ -17,6 +17,9 @@
"ap-east-1" : {
"description" : "Asia Pacific (Hong Kong)"
},
"ap-east-2" : {
"description" : "Asia Pacific (Taipei)"
},
"ap-northeast-1" : {
"description" : "Asia Pacific (Tokyo)"
},
@@ -44,8 +47,17 @@
"ap-southeast-4" : {
"description" : "Asia Pacific (Melbourne)"
},
"ap-southeast-5" : {
"description" : "Asia Pacific (Malaysia)"
},
"ap-southeast-6" : {
"description" : "Asia Pacific (New Zealand)"
},
"ap-southeast-7" : {
"description" : "Asia Pacific (Thailand)"
},
"aws-global" : {
"description" : "AWS Standard global region"
"description" : "aws global region"
},
"ca-central-1" : {
"description" : "Canada (Central)"
@@ -86,6 +98,9 @@
"me-south-1" : {
"description" : "Middle East (Bahrain)"
},
"mx-central-1" : {
"description" : "Mexico (Central)"
},
"sa-east-1" : {
"description" : "South America (Sao Paulo)"
},
@@ -115,7 +130,7 @@
"regionRegex" : "^cn\\-\\w+\\-\\d+$",
"regions" : {
"aws-cn-global" : {
"description" : "AWS China global region"
"description" : "aws-cn global region"
},
"cn-north-1" : {
"description" : "China (Beijing)"
@@ -124,6 +139,107 @@
"description" : "China (Ningxia)"
}
}
}, {
"id" : "aws-eusc",
"outputs" : {
"dnsSuffix" : "amazonaws.eu",
"dualStackDnsSuffix" : "api.amazonwebservices.eu",
"implicitGlobalRegion" : "eusc-de-east-1",
"name" : "aws-eusc",
"supportsDualStack" : true,
"supportsFIPS" : true
},
"regionRegex" : "^eusc\\-(de)\\-\\w+\\-\\d+$",
"regions" : {
"eusc-de-east-1" : {
"description" : "EU (Germany)"
}
}
}, {
"id" : "aws-iso",
"outputs" : {
"dnsSuffix" : "c2s.ic.gov",
"dualStackDnsSuffix" : "api.aws.ic.gov",
"implicitGlobalRegion" : "us-iso-east-1",
"name" : "aws-iso",
"supportsDualStack" : true,
"supportsFIPS" : true
},
"regionRegex" : "^us\\-iso\\-\\w+\\-\\d+$",
"regions" : {
"aws-iso-global" : {
"description" : "aws-iso global region"
},
"us-iso-east-1" : {
"description" : "US ISO East"
},
"us-iso-west-1" : {
"description" : "US ISO WEST"
}
}
}, {
"id" : "aws-iso-b",
"outputs" : {
"dnsSuffix" : "sc2s.sgov.gov",
"dualStackDnsSuffix" : "api.aws.scloud",
"implicitGlobalRegion" : "us-isob-east-1",
"name" : "aws-iso-b",
"supportsDualStack" : true,
"supportsFIPS" : true
},
"regionRegex" : "^us\\-isob\\-\\w+\\-\\d+$",
"regions" : {
"aws-iso-b-global" : {
"description" : "aws-iso-b global region"
},
"us-isob-east-1" : {
"description" : "US ISOB East (Ohio)"
},
"us-isob-west-1" : {
"description" : "US ISOB West"
}
}
}, {
"id" : "aws-iso-e",
"outputs" : {
"dnsSuffix" : "cloud.adc-e.uk",
"dualStackDnsSuffix" : "api.cloud-aws.adc-e.uk",
"implicitGlobalRegion" : "eu-isoe-west-1",
"name" : "aws-iso-e",
"supportsDualStack" : true,
"supportsFIPS" : true
},
"regionRegex" : "^eu\\-isoe\\-\\w+\\-\\d+$",
"regions" : {
"aws-iso-e-global" : {
"description" : "aws-iso-e global region"
},
"eu-isoe-west-1" : {
"description" : "EU ISOE West"
}
}
}, {
"id" : "aws-iso-f",
"outputs" : {
"dnsSuffix" : "csp.hci.ic.gov",
"dualStackDnsSuffix" : "api.aws.hci.ic.gov",
"implicitGlobalRegion" : "us-isof-south-1",
"name" : "aws-iso-f",
"supportsDualStack" : true,
"supportsFIPS" : true
},
"regionRegex" : "^us\\-isof\\-\\w+\\-\\d+$",
"regions" : {
"aws-iso-f-global" : {
"description" : "aws-iso-f global region"
},
"us-isof-east-1" : {
"description" : "US ISOF EAST"
},
"us-isof-south-1" : {
"description" : "US ISOF SOUTH"
}
}
}, {
"id" : "aws-us-gov",
"outputs" : {
@@ -137,7 +253,7 @@
"regionRegex" : "^us\\-gov\\-\\w+\\-\\d+$",
"regions" : {
"aws-us-gov-global" : {
"description" : "AWS GovCloud (US) global region"
"description" : "aws-us-gov global region"
},
"us-gov-east-1" : {
"description" : "AWS GovCloud (US-East)"
@@ -146,75 +262,6 @@
"description" : "AWS GovCloud (US-West)"
}
}
}, {
"id" : "aws-iso",
"outputs" : {
"dnsSuffix" : "c2s.ic.gov",
"dualStackDnsSuffix" : "c2s.ic.gov",
"implicitGlobalRegion" : "us-iso-east-1",
"name" : "aws-iso",
"supportsDualStack" : false,
"supportsFIPS" : true
},
"regionRegex" : "^us\\-iso\\-\\w+\\-\\d+$",
"regions" : {
"aws-iso-global" : {
"description" : "AWS ISO (US) global region"
},
"us-iso-east-1" : {
"description" : "US ISO East"
},
"us-iso-west-1" : {
"description" : "US ISO WEST"
}
}
}, {
"id" : "aws-iso-b",
"outputs" : {
"dnsSuffix" : "sc2s.sgov.gov",
"dualStackDnsSuffix" : "sc2s.sgov.gov",
"implicitGlobalRegion" : "us-isob-east-1",
"name" : "aws-iso-b",
"supportsDualStack" : false,
"supportsFIPS" : true
},
"regionRegex" : "^us\\-isob\\-\\w+\\-\\d+$",
"regions" : {
"aws-iso-b-global" : {
"description" : "AWS ISOB (US) global region"
},
"us-isob-east-1" : {
"description" : "US ISOB East (Ohio)"
}
}
}, {
"id" : "aws-iso-e",
"outputs" : {
"dnsSuffix" : "cloud.adc-e.uk",
"dualStackDnsSuffix" : "cloud.adc-e.uk",
"implicitGlobalRegion" : "eu-isoe-west-1",
"name" : "aws-iso-e",
"supportsDualStack" : false,
"supportsFIPS" : true
},
"regionRegex" : "^eu\\-isoe\\-\\w+\\-\\d+$",
"regions" : {
"eu-isoe-west-1" : {
"description" : "EU ISOE West"
}
}
}, {
"id" : "aws-iso-f",
"outputs" : {
"dnsSuffix" : "csp.hci.ic.gov",
"dualStackDnsSuffix" : "csp.hci.ic.gov",
"implicitGlobalRegion" : "us-isof-south-1",
"name" : "aws-iso-f",
"supportsDualStack" : false,
"supportsFIPS" : true
},
"regionRegex" : "^us\\-isof\\-\\w+\\-\\d+$",
"regions" : { }
} ],
"version" : "1.1"
}

View File

@@ -1,3 +1,148 @@
# v2.7.11 (2025-10-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.10 (2025-10-16)
* **Dependency Update**: Bump minimum Go version to 1.23.
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.9 (2025-09-26)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.8 (2025-09-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.7 (2025-09-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.6 (2025-08-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.5 (2025-08-27)
* **Dependency Update**: Update to smithy-go v1.23.0.
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.4 (2025-08-21)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.3 (2025-08-11)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.2 (2025-08-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.1 (2025-07-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.7.0 (2025-07-28)
* **Feature**: Add support for HTTP interceptors.
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.37 (2025-07-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.36 (2025-06-17)
* **Dependency Update**: Update to smithy-go v1.22.4.
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.35 (2025-06-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.34 (2025-02-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.33 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.32 (2025-02-05)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.31 (2025-01-31)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.30 (2025-01-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.29 (2025-01-24)
* **Dependency Update**: Updated to the latest SDK module versions
* **Dependency Update**: Upgrade to smithy-go v1.22.2.
# v2.6.28 (2025-01-15)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.27 (2025-01-09)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.26 (2024-12-19)
* **Bug Fix**: Fix improper use of printf-style functions.
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.25 (2024-12-02)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.24 (2024-11-18)
* **Dependency Update**: Update to smithy-go v1.22.1.
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.23 (2024-11-06)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.22 (2024-10-28)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.21 (2024-10-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.20 (2024-10-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.19 (2024-10-04)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.18 (2024-09-20)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.17 (2024-09-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.16 (2024-08-15)
* **Dependency Update**: Bump minimum Go version to 1.21.
* **Dependency Update**: Updated to the latest SDK module versions
# v2.6.15 (2024-07-10.2)
* **Dependency Update**: Updated to the latest SDK module versions

View File

@@ -3,4 +3,4 @@
package endpoints
// goModuleVersion is the tagged release for this module
const goModuleVersion = "2.6.15"
const goModuleVersion = "2.7.11"

View File

@@ -1,3 +1,19 @@
# v1.8.4 (2025-10-16)
* **Dependency Update**: Bump minimum Go version to 1.23.
# v1.8.3 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
# v1.8.2 (2025-01-24)
* **Bug Fix**: Refactor filepath.Walk to filepath.WalkDir
# v1.8.1 (2024-08-15)
* **Dependency Update**: Bump minimum Go version to 1.21.
# v1.8.0 (2024-02-13)
* **Feature**: Bump minimum Go version to 1.20 per our language support policy.

View File

@@ -3,4 +3,4 @@
package ini
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.8.0"
const goModuleVersion = "1.8.4"

View File

@@ -1,3 +1,394 @@
# v1.58.5 (2025-10-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.58.4 (2025-10-22)
* No change notes available for this release.
# v1.58.3 (2025-10-16)
* **Dependency Update**: Bump minimum Go version to 1.23.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.58.2 (2025-09-26)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.58.1 (2025-09-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.58.0 (2025-09-16)
* **Feature**: Cloudwatch Logs added support for 2 new API parameters in metric and subscription filter APIs to filter log events based on system field values and emit system field values as dimensions and send them to customer destination as additional metadata.
# v1.57.4 (2025-09-10)
* No change notes available for this release.
# v1.57.3 (2025-09-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.57.2 (2025-08-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.57.1 (2025-08-27)
* **Dependency Update**: Update to smithy-go v1.23.0.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.57.0 (2025-08-25)
* **Feature**: Remove incorrect endpoint tests
# v1.56.2 (2025-08-21)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.56.1 (2025-08-20)
* **Bug Fix**: Remove unused deserialization code.
# v1.56.0 (2025-08-11)
* **Feature**: Add support for configuring per-service Options via callback on global config.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.55.0 (2025-08-04)
* **Feature**: Support configurable auth scheme preferences in service clients via AWS_AUTH_SCHEME_PREFERENCE in the environment, auth_scheme_preference in the config file, and through in-code settings on LoadDefaultConfig and client constructor methods.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.54.1 (2025-07-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.54.0 (2025-07-28)
* **Feature**: Add support for HTTP interceptors.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.53.1 (2025-07-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.53.0 (2025-07-18)
* **Feature**: CloudWatchLogs launches GetLogObject API with streaming support for efficient log data retrieval. Logs added support for new AccountPolicy type METRIC_EXTRACTION_POLICY. For more information, see CloudWatch Logs API documentation
# v1.52.0 (2025-07-16.2)
* **Feature**: CloudWatch Logs updates: Added X-Ray tracing for Amazon Bedrock Agent resources. Logs introduced Log Group level resource policies (managed through Put/Delete/Describe Resource Policy APIs). For more information, see CloudWatch Logs API documentation.
# v1.51.0 (2025-06-18)
* **Feature**: Added CloudWatch Logs Transformer support for converting CloudTrail, VPC Flow, EKS Audit, AWS WAF and Route53 Resolver logs to OCSF v1.1 format.
# v1.50.3 (2025-06-17)
* **Dependency Update**: Update to smithy-go v1.22.4.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.50.2 (2025-06-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.50.1 (2025-06-06)
* No change notes available for this release.
# v1.50.0 (2025-05-14)
* **Feature**: This release adds a new API "ListLogGroups" and an improvement in API "DescribeLogGroups"
# v1.49.0 (2025-05-09)
* **Feature**: We are pleased to announce limit increases to our grok processor logs transformation feature. Now you can define 20 Grok patterns in their configurations, with an expanded total pattern matching limit of 512 characters.
# v1.48.0 (2025-04-30)
* **Feature**: CloudWatch Logs supports "DELIVERY" log class. This log class is used only for delivering AWS Lambda logs to Amazon S3 or Amazon Data Firehose.
# v1.47.3 (2025-04-10)
* No change notes available for this release.
# v1.47.2 (2025-04-03)
* No change notes available for this release.
# v1.47.1 (2025-03-20)
* No change notes available for this release.
# v1.47.0 (2025-03-13)
* **Feature**: Updated CreateLogAnomalyDetector to accept only kms key arn
# v1.46.1 (2025-03-04.2)
* **Bug Fix**: Add assurance test for operation order.
# v1.46.0 (2025-02-27)
* **Feature**: Track credential providers via User-Agent Feature ids
* **Dependency Update**: Updated to the latest SDK module versions
# v1.45.14 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
* **Dependency Update**: Updated to the latest SDK module versions
# v1.45.13 (2025-02-14)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.45.12 (2025-02-05)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.45.11 (2025-02-04)
* No change notes available for this release.
# v1.45.10 (2025-01-31)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.45.9 (2025-01-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.45.8 (2025-01-24)
* **Dependency Update**: Updated to the latest SDK module versions
* **Dependency Update**: Upgrade to smithy-go v1.22.2.
# v1.45.7 (2025-01-21)
* **Documentation**: Documentation-only update to address doc errors
# v1.45.6 (2025-01-17)
* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop.
# v1.45.5 (2025-01-15)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.45.4 (2025-01-14)
* No change notes available for this release.
# v1.45.3 (2025-01-09)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.45.2 (2025-01-08)
* No change notes available for this release.
# v1.45.1 (2024-12-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.45.0 (2024-12-02)
* **Feature**: Adds PutIntegration, GetIntegration, ListIntegrations and DeleteIntegration APIs. Adds QueryLanguage support to StartQuery, GetQueryResults, DescribeQueries, DescribeQueryDefinitions, and PutQueryDefinition APIs.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.44.0 (2024-11-21)
* **Feature**: Adds "Create field indexes to improve query performance and reduce scan volume" and "Transform logs during ingestion". Updates documentation for "PutLogEvents with Entity".
# v1.43.3 (2024-11-18)
* **Dependency Update**: Update to smithy-go v1.22.1.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.43.2 (2024-11-07)
* **Bug Fix**: Adds case-insensitive handling of error message fields in service responses
# v1.43.1 (2024-11-06)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.43.0 (2024-10-29)
* **Feature**: Added support for new optional baseline parameter in the UpdateAnomaly API. For UpdateAnomaly requests with baseline set to True, The anomaly behavior is then treated as baseline behavior. However, more severe occurrences of this behavior will still be reported as anomalies.
# v1.42.1 (2024-10-28)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.42.0 (2024-10-25)
* **Feature**: Adding inferred token name for dynamic tokens in Anomalies.
# v1.41.2 (2024-10-08)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.41.1 (2024-10-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.41.0 (2024-10-04)
* **Feature**: Add support for HTTP client metrics.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.40.4 (2024-10-03)
* No change notes available for this release.
# v1.40.3 (2024-09-27)
* No change notes available for this release.
# v1.40.2 (2024-09-25)
* No change notes available for this release.
# v1.40.1 (2024-09-23)
* No change notes available for this release.
# v1.40.0 (2024-09-20)
* **Feature**: Add tracing and metrics support to service clients.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.39.1 (2024-09-17)
* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution.
# v1.39.0 (2024-09-04)
* **Feature**: Update to support new APIs for delivery of logs from AWS services.
# v1.38.1 (2024-09-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.38.0 (2024-08-30)
* **Feature**: This release introduces a new optional parameter: Entity, in PutLogEvents request
# v1.37.5 (2024-08-22)
* No change notes available for this release.
# v1.37.4 (2024-08-15)
* **Dependency Update**: Bump minimum Go version to 1.21.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.37.3 (2024-07-10.2)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.37.2 (2024-07-10)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.37.1 (2024-06-28)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.37.0 (2024-06-26)
* **Feature**: Support list-of-string endpoint parameter.
# v1.36.1 (2024-06-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.36.0 (2024-06-18)
* **Feature**: Track usage of various AWS SDK features in user-agent string.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.35.8 (2024-06-17)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.35.7 (2024-06-07)
* **Bug Fix**: Add clock skew correction on all service clients
* **Dependency Update**: Updated to the latest SDK module versions
# v1.35.6 (2024-06-03)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.35.5 (2024-05-23)
* No change notes available for this release.
# v1.35.4 (2024-05-16)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.35.3 (2024-05-15)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.35.2 (2024-05-08)
* **Bug Fix**: GoDoc improvement
# v1.35.1 (2024-03-29)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.35.0 (2024-03-19)
* **Feature**: Update LogSamples field in Anomaly model to be a list of LogEvent
# v1.34.4 (2024-03-18)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.34.3 (2024-03-07)
* **Bug Fix**: Remove dependency on go-cmp.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.34.2 (2024-02-29)
* No change notes available for this release.
# v1.34.1 (2024-02-23)
* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.34.0 (2024-02-22)
* **Feature**: Add middleware stack snapshot tests.
# v1.33.3 (2024-02-21)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.33.2 (2024-02-20)
* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure.
# v1.33.1 (2024-02-15)
* **Bug Fix**: Correct failure to determine the error type in awsJson services that could occur when errors were modeled with a non-string `code` field.
# v1.33.0 (2024-02-13)
* **Feature**: Bump minimum Go version to 1.20 per our language support policy.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.32.0 (2024-02-06)
* **Feature**: This release adds a new field, logGroupArn, to the response of the logs:DescribeLogGroups action.

View File

@@ -5,6 +5,7 @@ package cloudwatchlogs
import (
"context"
cryptorand "crypto/rand"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
@@ -15,24 +16,159 @@ import (
internalauth "github.com/aws/aws-sdk-go-v2/internal/auth"
internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware"
smithy "github.com/aws/smithy-go"
smithyauth "github.com/aws/smithy-go/auth"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/metrics"
"github.com/aws/smithy-go/middleware"
smithyrand "github.com/aws/smithy-go/rand"
"github.com/aws/smithy-go/tracing"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"sync/atomic"
"time"
)
const ServiceID = "CloudWatch Logs"
const ServiceAPIVersion = "2014-03-28"
type operationMetrics struct {
Duration metrics.Float64Histogram
SerializeDuration metrics.Float64Histogram
ResolveIdentityDuration metrics.Float64Histogram
ResolveEndpointDuration metrics.Float64Histogram
SignRequestDuration metrics.Float64Histogram
DeserializeDuration metrics.Float64Histogram
}
func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram {
switch name {
case "client.call.duration":
return m.Duration
case "client.call.serialization_duration":
return m.SerializeDuration
case "client.call.resolve_identity_duration":
return m.ResolveIdentityDuration
case "client.call.resolve_endpoint_duration":
return m.ResolveEndpointDuration
case "client.call.signing_duration":
return m.SignRequestDuration
case "client.call.deserialization_duration":
return m.DeserializeDuration
default:
panic("unrecognized operation metric")
}
}
func timeOperationMetric[T any](
ctx context.Context, metric string, fn func() (T, error),
opts ...metrics.RecordMetricOption,
) (T, error) {
instr := getOperationMetrics(ctx).histogramFor(metric)
opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...)
start := time.Now()
v, err := fn()
end := time.Now()
elapsed := end.Sub(start)
instr.Record(ctx, float64(elapsed)/1e9, opts...)
return v, err
}
func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() {
instr := getOperationMetrics(ctx).histogramFor(metric)
opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...)
var ended bool
start := time.Now()
return func() {
if ended {
return
}
ended = true
end := time.Now()
elapsed := end.Sub(start)
instr.Record(ctx, float64(elapsed)/1e9, opts...)
}
}
func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption {
return func(o *metrics.RecordMetricOptions) {
o.Properties.Set("rpc.service", middleware.GetServiceID(ctx))
o.Properties.Set("rpc.method", middleware.GetOperationName(ctx))
}
}
type operationMetricsKey struct{}
func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) {
meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs")
om := &operationMetrics{}
var err error
om.Duration, err = operationMetricTimer(meter, "client.call.duration",
"Overall call duration (including retries and time to send or receive request and response body)")
if err != nil {
return nil, err
}
om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration",
"The time it takes to serialize a message body")
if err != nil {
return nil, err
}
om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration",
"The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider")
if err != nil {
return nil, err
}
om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration",
"The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request")
if err != nil {
return nil, err
}
om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration",
"The time it takes to sign a request")
if err != nil {
return nil, err
}
om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration",
"The time it takes to deserialize a message body")
if err != nil {
return nil, err
}
return context.WithValue(parent, operationMetricsKey{}, om), nil
}
func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) {
return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) {
o.UnitLabel = "s"
o.Description = desc
})
}
func getOperationMetrics(ctx context.Context) *operationMetrics {
return ctx.Value(operationMetricsKey{}).(*operationMetrics)
}
func operationTracer(p tracing.TracerProvider) tracing.Tracer {
return p.Tracer("github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs")
}
// Client provides the API client to make operations call for Amazon CloudWatch
// Logs.
type Client struct {
options Options
// Difference between the time reported by the server and the client
timeOffset *atomic.Int64
}
// New returns an initialized Client based on the functional options. Provide
@@ -55,6 +191,10 @@ func New(options Options, optFns ...func(*Options)) *Client {
resolveEndpointResolverV2(&options)
resolveTracerProvider(&options)
resolveMeterProvider(&options)
resolveAuthSchemeResolver(&options)
for _, fn := range optFns {
@@ -73,6 +213,8 @@ func New(options Options, optFns ...func(*Options)) *Client {
options: options,
}
initializeTimeOffsetResolver(client)
return client
}
@@ -85,8 +227,15 @@ func (c *Client) Options() Options {
return c.options.Copy()
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
func (c *Client) invokeOperation(
ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error,
) (
result interface{}, metadata middleware.Metadata, err error,
) {
ctx = middleware.ClearStackValues(ctx)
ctx = middleware.WithServiceID(ctx, ServiceID)
ctx = middleware.WithOperationName(ctx, opID)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
@@ -112,15 +261,56 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
ctx, err = withOperationMetrics(ctx, options.MeterProvider)
if err != nil {
return nil, metadata, err
}
tracer := operationTracer(options.TracerProvider)
spanName := fmt.Sprintf("%s.%s", ServiceID, opID)
ctx = tracing.WithOperationTracer(ctx, tracer)
ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) {
o.Kind = tracing.SpanKindClient
o.Properties.Set("rpc.system", "aws-api")
o.Properties.Set("rpc.method", opID)
o.Properties.Set("rpc.service", ServiceID)
})
endTimer := startMetricTimer(ctx, "client.call.duration")
defer endTimer()
defer span.End()
handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) {
o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs")
})
decorated := middleware.DecorateHandler(handler, stack)
result, metadata, err = decorated.Handle(ctx, params)
if err != nil {
span.SetProperty("exception.type", fmt.Sprintf("%T", err))
span.SetProperty("exception.message", err.Error())
var aerr smithy.APIError
if errors.As(err, &aerr) {
span.SetProperty("api.error_code", aerr.ErrorCode())
span.SetProperty("api.error_message", aerr.ErrorMessage())
span.SetProperty("api.error_fault", aerr.ErrorFault().String())
}
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
span.SetProperty("error", err != nil)
if err == nil {
span.SetStatus(tracing.SpanStatusOK)
} else {
span.SetStatus(tracing.SpanStatusError)
}
return result, metadata, err
}
@@ -158,7 +348,7 @@ func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, o
if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil {
return fmt.Errorf("add ResolveEndpointV2: %v", err)
}
if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil {
if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil {
return fmt.Errorf("add Signing: %w", err)
}
return nil
@@ -236,24 +426,33 @@ func setResolvedDefaultsMode(o *Options) {
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
AppID: cfg.AppID,
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
AppID: cfg.AppID,
AuthSchemePreference: cfg.AuthSchemePreference,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveInterceptors(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
resolveBaseEndpoint(cfg, &opts)
return New(opts, optFns...)
return New(opts, func(o *Options) {
for _, opt := range cfg.ServiceOptions {
opt(ServiceID, o)
}
for _, opt := range optFns {
opt(o)
}
})
}
func resolveHTTPClient(o *Options) {
@@ -367,18 +566,42 @@ func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions)
}
func resolveInterceptors(cfg aws.Config, o *Options) {
o.Interceptors = cfg.Interceptors.Copy()
}
func addClientUserAgent(stack *middleware.Stack, options Options) error {
if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "cloudwatchlogs", goModuleVersion)(stack); err != nil {
ua, err := getOrAddRequestUserAgent(stack)
if err != nil {
return err
}
ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "cloudwatchlogs", goModuleVersion)
if len(options.AppID) > 0 {
return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack)
ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)
}
return nil
}
func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) {
id := (*awsmiddleware.RequestUserAgent)(nil).ID()
mw, ok := stack.Build.Get(id)
if !ok {
mw = awsmiddleware.NewRequestUserAgent()
if err := stack.Build.Add(mw, middleware.After); err != nil {
return nil, err
}
}
ua, ok := mw.(*awsmiddleware.RequestUserAgent)
if !ok {
return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id)
}
return ua, nil
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
@@ -397,6 +620,85 @@ func newDefaultV4Signer(o Options) *v4.Signer {
})
}
func addClientRequestID(stack *middleware.Stack) error {
return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After)
}
func addComputeContentLength(stack *middleware.Stack) error {
return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After)
}
func addRawResponseToMetadata(stack *middleware.Stack) error {
return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before)
}
func addRecordResponseTiming(stack *middleware.Stack) error {
return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After)
}
func addSpanRetryLoop(stack *middleware.Stack, options Options) error {
return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before)
}
type spanRetryLoop struct {
options Options
}
func (*spanRetryLoop) ID() string {
return "spanRetryLoop"
}
func (m *spanRetryLoop) HandleFinalize(
ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler,
) (
middleware.FinalizeOutput, middleware.Metadata, error,
) {
tracer := operationTracer(m.options.TracerProvider)
ctx, span := tracer.StartSpan(ctx, "RetryLoop")
defer span.End()
return next.HandleFinalize(ctx, in)
}
func addStreamingEventsPayload(stack *middleware.Stack) error {
return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before)
}
func addUnsignedPayload(stack *middleware.Stack) error {
return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After)
}
func addComputePayloadSHA256(stack *middleware.Stack) error {
return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After)
}
func addContentSHA256Header(stack *middleware.Stack) error {
return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After)
}
func addIsWaiterUserAgent(o *Options) {
o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
ua, err := getOrAddRequestUserAgent(stack)
if err != nil {
return err
}
ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter)
return nil
})
}
func addIsPaginatorUserAgent(o *Options) {
o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
ua, err := getOrAddRequestUserAgent(stack)
if err != nil {
return err
}
ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator)
return nil
})
}
func resolveIdempotencyTokenProvider(o *Options) {
if o.IdempotencyTokenProvider != nil {
return
@@ -404,12 +706,18 @@ func resolveIdempotencyTokenProvider(o *Options) {
o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
func addRetry(stack *middleware.Stack, o Options) error {
attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) {
m.LogAttempts = o.ClientLogMode.IsRetries()
m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs")
})
if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil {
return err
}
return retry.AddRetryMiddlewares(stack, mo)
if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil {
return err
}
return nil
}
// resolves dual-stack endpoint configuration
@@ -442,17 +750,104 @@ func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
return nil
}
func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string {
if mode == aws.AccountIDEndpointModeDisabled {
return nil
}
if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" {
return aws.String(ca.Credentials.AccountID)
}
return nil
}
func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error {
mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset}
if err := stack.Build.Add(&mw, middleware.After); err != nil {
return err
}
return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before)
}
func initializeTimeOffsetResolver(c *Client) {
c.timeOffset = new(atomic.Int64)
}
func addUserAgentRetryMode(stack *middleware.Stack, options Options) error {
ua, err := getOrAddRequestUserAgent(stack)
if err != nil {
return err
}
switch options.Retryer.(type) {
case *retry.Standard:
ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard)
case *retry.AdaptiveMode:
ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive)
}
return nil
}
type setCredentialSourceMiddleware struct {
ua *awsmiddleware.RequestUserAgent
options Options
}
func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" }
func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (
out middleware.BuildOutput, metadata middleware.Metadata, err error,
) {
asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource)
if !ok {
return next.HandleBuild(ctx, in)
}
providerSources := asProviderSource.ProviderSources()
for _, source := range providerSources {
m.ua.AddCredentialsSource(source)
}
return next.HandleBuild(ctx, in)
}
func addCredentialSource(stack *middleware.Stack, options Options) error {
ua, err := getOrAddRequestUserAgent(stack)
if err != nil {
return err
}
mw := setCredentialSourceMiddleware{ua: ua, options: options}
return stack.Build.Insert(&mw, "UserAgent", middleware.Before)
}
func resolveTracerProvider(options *Options) {
if options.TracerProvider == nil {
options.TracerProvider = &tracing.NopTracerProvider{}
}
}
func resolveMeterProvider(options *Options) {
if options.MeterProvider == nil {
options.MeterProvider = metrics.NopMeterProvider{}
}
}
// IdempotencyTokenProvider interface for providing idempotency token
type IdempotencyTokenProvider interface {
GetIdempotencyToken() (string, error)
}
func addRecursionDetection(stack *middleware.Stack) error {
return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After)
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
@@ -492,3 +887,152 @@ func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {
DisableHTTPS: o.EndpointOptions.DisableHTTPS,
}, "ResolveEndpointV2", middleware.After)
}
func addInterceptBeforeRetryLoop(stack *middleware.Stack, opts Options) error {
return stack.Finalize.Insert(&smithyhttp.InterceptBeforeRetryLoop{
Interceptors: opts.Interceptors.BeforeRetryLoop,
}, "Retry", middleware.Before)
}
func addInterceptAttempt(stack *middleware.Stack, opts Options) error {
return stack.Finalize.Insert(&smithyhttp.InterceptAttempt{
BeforeAttempt: opts.Interceptors.BeforeAttempt,
AfterAttempt: opts.Interceptors.AfterAttempt,
}, "Retry", middleware.After)
}
func addInterceptExecution(stack *middleware.Stack, opts Options) error {
return stack.Initialize.Add(&smithyhttp.InterceptExecution{
BeforeExecution: opts.Interceptors.BeforeExecution,
AfterExecution: opts.Interceptors.AfterExecution,
}, middleware.Before)
}
func addInterceptBeforeSerialization(stack *middleware.Stack, opts Options) error {
return stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{
Interceptors: opts.Interceptors.BeforeSerialization,
}, "OperationSerializer", middleware.Before)
}
func addInterceptAfterSerialization(stack *middleware.Stack, opts Options) error {
return stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{
Interceptors: opts.Interceptors.AfterSerialization,
}, "OperationSerializer", middleware.After)
}
func addInterceptBeforeSigning(stack *middleware.Stack, opts Options) error {
return stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{
Interceptors: opts.Interceptors.BeforeSigning,
}, "Signing", middleware.Before)
}
func addInterceptAfterSigning(stack *middleware.Stack, opts Options) error {
return stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{
Interceptors: opts.Interceptors.AfterSigning,
}, "Signing", middleware.After)
}
func addInterceptTransmit(stack *middleware.Stack, opts Options) error {
return stack.Deserialize.Add(&smithyhttp.InterceptTransmit{
BeforeTransmit: opts.Interceptors.BeforeTransmit,
AfterTransmit: opts.Interceptors.AfterTransmit,
}, middleware.After)
}
func addInterceptBeforeDeserialization(stack *middleware.Stack, opts Options) error {
return stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{
Interceptors: opts.Interceptors.BeforeDeserialization,
}, "OperationDeserializer", middleware.After) // (deserialize stack is called in reverse)
}
func addInterceptAfterDeserialization(stack *middleware.Stack, opts Options) error {
return stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{
Interceptors: opts.Interceptors.AfterDeserialization,
}, "OperationDeserializer", middleware.Before)
}
type spanInitializeStart struct {
}
func (*spanInitializeStart) ID() string {
return "spanInitializeStart"
}
func (m *spanInitializeStart) HandleInitialize(
ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler,
) (
middleware.InitializeOutput, middleware.Metadata, error,
) {
ctx, _ = tracing.StartSpan(ctx, "Initialize")
return next.HandleInitialize(ctx, in)
}
type spanInitializeEnd struct {
}
func (*spanInitializeEnd) ID() string {
return "spanInitializeEnd"
}
func (m *spanInitializeEnd) HandleInitialize(
ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler,
) (
middleware.InitializeOutput, middleware.Metadata, error,
) {
ctx, span := tracing.PopSpan(ctx)
span.End()
return next.HandleInitialize(ctx, in)
}
type spanBuildRequestStart struct {
}
func (*spanBuildRequestStart) ID() string {
return "spanBuildRequestStart"
}
func (m *spanBuildRequestStart) HandleSerialize(
ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler,
) (
middleware.SerializeOutput, middleware.Metadata, error,
) {
ctx, _ = tracing.StartSpan(ctx, "BuildRequest")
return next.HandleSerialize(ctx, in)
}
type spanBuildRequestEnd struct {
}
func (*spanBuildRequestEnd) ID() string {
return "spanBuildRequestEnd"
}
func (m *spanBuildRequestEnd) HandleBuild(
ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler,
) (
middleware.BuildOutput, middleware.Metadata, error,
) {
ctx, span := tracing.PopSpan(ctx)
span.End()
return next.HandleBuild(ctx, in)
}
func addSpanInitializeStart(stack *middleware.Stack) error {
return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before)
}
func addSpanInitializeEnd(stack *middleware.Stack) error {
return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After)
}
func addSpanBuildRequestStart(stack *middleware.Stack) error {
return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before)
}
func addSpanBuildRequestEnd(stack *middleware.Stack) error {
return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After)
}

View File

@@ -6,46 +6,66 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associates the specified KMS key with either one log group in the account, or
// with all stored CloudWatch Logs query insights results in the account. When you
// use AssociateKmsKey , you specify either the logGroupName parameter or the
// resourceIdentifier parameter. You can't specify both of those parameters in the
// same operation.
// - Specify the logGroupName parameter to cause all log events stored in the log
// group to be encrypted with that key. Only the log events ingested after the key
// is associated are encrypted with that key. Associating a KMS key with a log
// group overrides any existing associations between the log group and a KMS key.
// After a KMS key is associated with a log group, all newly ingested data for the
// log group is encrypted using the KMS key. This association is stored as long as
// the data encrypted with the KMS key is still within CloudWatch Logs. This
// enables CloudWatch Logs to decrypt this data whenever it is requested.
// Associating a key with a log group does not cause the results of queries of that
// log group to be encrypted with that key. To have query results encrypted with a
// KMS key, you must use an AssociateKmsKey operation with the resourceIdentifier
// parameter that specifies a query-result resource.
// - Specify the resourceIdentifier parameter with a query-result resource, to
// use that key to encrypt the stored results of all future StartQuery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html)
// operations in the account. The response from a GetQueryResults (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html)
// operation will still return the query results in plain text. Even if you have
// not associated a key with your query results, the query results are encrypted
// when stored, using the default CloudWatch Logs method. If you run a query from a
// monitoring account that queries logs in a source account, the query results key
// from the monitoring account, if any, is used.
// with all stored CloudWatch Logs query insights results in the account.
//
// When you use AssociateKmsKey , you specify either the logGroupName parameter or
// the resourceIdentifier parameter. You can't specify both of those parameters in
// the same operation.
//
// - Specify the logGroupName parameter to cause log events ingested into that
// log group to be encrypted with that key. Only the log events ingested after the
// key is associated are encrypted with that key.
//
// Associating a KMS key with a log group overrides any existing associations
//
// between the log group and a KMS key. After a KMS key is associated with a log
// group, all newly ingested data for the log group is encrypted using the KMS key.
// This association is stored as long as the data encrypted with the KMS key is
// still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data
// whenever it is requested.
//
// Associating a key with a log group does not cause the results of queries of
//
// that log group to be encrypted with that key. To have query results encrypted
// with a KMS key, you must use an AssociateKmsKey operation with the
// resourceIdentifier parameter that specifies a query-result resource.
//
// - Specify the resourceIdentifier parameter with a query-result resource, to
// use that key to encrypt the stored results of all future [StartQuery]operations in the
// account. The response from a [GetQueryResults]operation will still return the query results in
// plain text.
//
// Even if you have not associated a key with your query results, the query
//
// results are encrypted when stored, using the default CloudWatch Logs method.
//
// If you run a query from a monitoring account that queries logs in a source
//
// account, the query results key from the monitoring account, if any, is used.
//
// If you delete the key that is used to encrypt log events or log group query
// results, then all the associated stored log events or query results that were
// encrypted with that key will be unencryptable and unusable. CloudWatch Logs
// supports only symmetric KMS keys. Do not use an associate an asymmetric KMS key
// with your log group or query results. For more information, see Using Symmetric
// and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
// . It can take up to 5 minutes for this operation to take effect. If you attempt
// to associate a KMS key with a log group but the KMS key does not exist or the
// KMS key is disabled, you receive an InvalidParameterException error.
// encrypted with that key will be unencryptable and unusable.
//
// CloudWatch Logs supports only symmetric KMS keys. Do not associate an
// asymmetric KMS key with your log group or query results. For more information,
// see [Using Symmetric and Asymmetric Keys].
//
// It can take up to 5 minutes for this operation to take effect.
//
// If you attempt to associate a KMS key with a log group but the KMS key does not
// exist or the KMS key is disabled, you receive an InvalidParameterException
// error.
//
// [Using Symmetric and Asymmetric Keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
//
// [StartQuery]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html
// [GetQueryResults]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html
func (c *Client) AssociateKmsKey(ctx context.Context, params *AssociateKmsKeyInput, optFns ...func(*Options)) (*AssociateKmsKeyOutput, error) {
if params == nil {
params = &AssociateKmsKeyInput{}
@@ -64,32 +84,41 @@ func (c *Client) AssociateKmsKey(ctx context.Context, params *AssociateKmsKeyInp
type AssociateKmsKeyInput struct {
// The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data.
// This must be a symmetric KMS key. For more information, see Amazon Resource
// Names (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms)
// and Using Symmetric and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
// .
// This must be a symmetric KMS key. For more information, see [Amazon Resource Names]and [Using Symmetric and Asymmetric Keys].
//
// [Amazon Resource Names]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms
// [Using Symmetric and Asymmetric Keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
//
// This member is required.
KmsKeyId *string
// The name of the log group. In your AssociateKmsKey operation, you must specify
// either the resourceIdentifier parameter or the logGroup parameter, but you
// can't specify both.
// The name of the log group.
//
// In your AssociateKmsKey operation, you must specify either the
// resourceIdentifier parameter or the logGroup parameter, but you can't specify
// both.
LogGroupName *string
// Specifies the target for this operation. You must specify one of the following:
// - Specify the following ARN to have future GetQueryResults (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html)
// operations in this account encrypt the results with the specified KMS key.
// Replace REGION and ACCOUNT_ID with your Region and account ID.
// arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
//
// - Specify the following ARN to have future [GetQueryResults]operations in this account encrypt
// the results with the specified KMS key. Replace REGION and ACCOUNT_ID with your
// Region and account ID.
//
// arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
//
// - Specify the ARN of a log group to have CloudWatch Logs use the KMS key to
// encrypt log events that are ingested and stored by that log group. The log group
// ARN must be in the following format. Replace REGION and ACCOUNT_ID with your
// Region and account ID.
// arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
//
// arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
//
// In your AssociateKmsKey operation, you must specify either the
// resourceIdentifier parameter or the logGroup parameter, but you can't specify
// both.
//
// [GetQueryResults]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html
ResourceIdentifier *string
noSmithyDocumentSerde
@@ -124,25 +153,28 @@ func (c *Client) addOperationAssociateKmsKeyMiddlewares(stack *middleware.Stack,
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -157,13 +189,22 @@ func (c *Client) addOperationAssociateKmsKeyMiddlewares(stack *middleware.Stack,
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpAssociateKmsKeyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateKmsKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -178,6 +219,48 @@ func (c *Client) addOperationAssociateKmsKeyMiddlewares(stack *middleware.Stack,
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,13 +6,13 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Cancels the specified export task. The task must be in the PENDING or RUNNING
// state.
// Cancels the specified export task.
//
// The task must be in the PENDING or RUNNING state.
func (c *Client) CancelExportTask(ctx context.Context, params *CancelExportTaskInput, optFns ...func(*Options)) (*CancelExportTaskOutput, error) {
if params == nil {
params = &CancelExportTaskInput{}
@@ -67,25 +67,28 @@ func (c *Client) addOperationCancelExportTaskMiddlewares(stack *middleware.Stack
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -100,13 +103,22 @@ func (c *Client) addOperationCancelExportTaskMiddlewares(stack *middleware.Stack
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpCancelExportTaskValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelExportTask(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -121,6 +133,48 @@ func (c *Client) addOperationCancelExportTaskMiddlewares(stack *middleware.Stack
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,41 +6,49 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a delivery. A delivery is a connection between a logical delivery
// source and a logical delivery destination that you have already created. Only
// some Amazon Web Services services support being configured as a delivery source
// using this operation. These services are listed as Supported [V2 Permissions] in
// the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html)
// source and a logical delivery destination that you have already created.
//
// Only some Amazon Web Services services support being configured as a delivery
// source using this operation. These services are listed as Supported [V2
// Permissions] in the table at [Enabling logging from Amazon Web Services services.]
//
// A delivery destination can represent a log group in CloudWatch Logs, an Amazon
// S3 bucket, or a delivery stream in Kinesis Data Firehose. To configure logs
// delivery between a supported Amazon Web Services service and a destination, you
// must do the following:
// S3 bucket, a delivery stream in Firehose, or X-Ray.
//
// To configure logs delivery between a supported Amazon Web Services service and
// a destination, you must do the following:
//
// - Create a delivery source, which is a logical object that represents the
// resource that is actually sending the logs. For more information, see
// PutDeliverySource (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html)
// .
// resource that is actually sending the logs. For more information, see [PutDeliverySource].
//
// - Create a delivery destination, which is a logical object that represents
// the actual delivery destination. For more information, see
// PutDeliveryDestination (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html)
// .
// - If you are delivering logs cross-account, you must use
// PutDeliveryDestinationPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html)
// in the destination account to assign an IAM policy to the destination. This
// policy allows delivery to that destination.
// the actual delivery destination. For more information, see [PutDeliveryDestination].
//
// - If you are delivering logs cross-account, you must use [PutDeliveryDestinationPolicy]in the destination
// account to assign an IAM policy to the destination. This policy allows delivery
// to that destination.
//
// - Use CreateDelivery to create a delivery by pairing exactly one delivery
// source and one delivery destination.
//
// You can configure a single delivery source to send logs to multiple
// destinations by creating multiple deliveries. You can also create multiple
// deliveries to configure multiple delivery sources to send logs to the same
// delivery destination. You can't update an existing delivery. You can only create
// and delete deliveries.
// delivery destination.
//
// To update an existing delivery configuration, use [UpdateDeliveryConfiguration].
//
// [PutDeliveryDestination]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html
// [PutDeliverySource]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html
// [Enabling logging from Amazon Web Services services.]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html
// [PutDeliveryDestinationPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html
// [UpdateDeliveryConfiguration]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UpdateDeliveryConfiguration.html
func (c *Client) CreateDelivery(ctx context.Context, params *CreateDeliveryInput, optFns ...func(*Options)) (*CreateDeliveryOutput, error) {
if params == nil {
params = &CreateDeliveryInput{}
@@ -68,8 +76,23 @@ type CreateDeliveryInput struct {
// This member is required.
DeliverySourceName *string
// An optional list of key-value pairs to associate with the resource. For more
// information about tagging, see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// The field delimiter to use between record fields when the final output format
// of a delivery is in Plain , W3C , or Raw format.
FieldDelimiter *string
// The list of record fields to be delivered to the destination, in order. If the
// delivery's log source has mandatory fields, they must be included in this list.
RecordFields []string
// This structure contains parameters that are valid only when the delivery's
// delivery destination is an S3 bucket.
S3DeliveryConfiguration *types.S3DeliveryConfiguration
// An optional list of key-value pairs to associate with the resource.
//
// For more information about tagging, see [Tagging Amazon Web Services resources]
//
// [Tagging Amazon Web Services resources]: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
Tags map[string]string
noSmithyDocumentSerde
@@ -108,25 +131,28 @@ func (c *Client) addOperationCreateDeliveryMiddlewares(stack *middleware.Stack,
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -141,13 +167,22 @@ func (c *Client) addOperationCreateDeliveryMiddlewares(stack *middleware.Stack,
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpCreateDeliveryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDelivery(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -162,6 +197,48 @@ func (c *Client) addOperationCreateDeliveryMiddlewares(stack *middleware.Stack,
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -14,21 +13,34 @@ import (
// Creates an export task so that you can efficiently export data from a log group
// to an Amazon S3 bucket. When you perform a CreateExportTask operation, you must
// use credentials that have permission to write to the S3 bucket that you specify
// as the destination. Exporting log data to S3 buckets that are encrypted by KMS
// is supported. Exporting log data to Amazon S3 buckets that have S3 Object Lock
// enabled with a retention period is also supported. Exporting to S3 buckets that
// are encrypted with AES-256 is supported. This is an asynchronous call. If all
// the required information is provided, this operation initiates an export task
// and responds with the ID of the task. After the task has started, you can use
// DescribeExportTasks (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeExportTasks.html)
// to get the status of the export task. Each account can only have one active (
// RUNNING or PENDING ) export task at a time. To cancel an export task, use
// CancelExportTask (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CancelExportTask.html)
// . You can export logs from multiple log groups or multiple time ranges to the
// as the destination.
//
// Exporting log data to S3 buckets that are encrypted by KMS is supported.
// Exporting log data to Amazon S3 buckets that have S3 Object Lock enabled with a
// retention period is also supported.
//
// Exporting to S3 buckets that are encrypted with AES-256 is supported.
//
// This is an asynchronous call. If all the required information is provided, this
// operation initiates an export task and responds with the ID of the task. After
// the task has started, you can use [DescribeExportTasks]to get the status of the export task. Each
// account can only have one active ( RUNNING or PENDING ) export task at a time.
// To cancel an export task, use [CancelExportTask].
//
// You can export logs from multiple log groups or multiple time ranges to the
// same S3 bucket. To separate log data for each export task, specify a prefix to
// be used as the Amazon S3 key prefix for all exported objects. Time-based sorting
// on chunks of log data inside an exported file is not guaranteed. You can sort
// the exported log field data by using Linux utilities.
// be used as the Amazon S3 key prefix for all exported objects.
//
// We recommend that you don't regularly export to Amazon S3 as a way to
// continuously archive your logs. For that use case, we instead recommend that you
// use subscriptions. For more information about subscriptions, see [Real-time processing of log data with subscriptions].
//
// Time-based sorting on chunks of log data inside an exported file is not
// guaranteed. You can sort the exported log field data by using Linux utilities.
//
// [CancelExportTask]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CancelExportTask.html
// [DescribeExportTasks]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeExportTasks.html
// [Real-time processing of log data with subscriptions]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions.html
func (c *Client) CreateExportTask(ctx context.Context, params *CreateExportTaskInput, optFns ...func(*Options)) (*CreateExportTaskOutput, error) {
if params == nil {
params = &CreateExportTaskInput{}
@@ -66,14 +78,20 @@ type CreateExportTaskInput struct {
// The end time of the range for the request, expressed as the number of
// milliseconds after Jan 1, 1970 00:00:00 UTC . Events with a timestamp later than
// this time are not exported. You must specify a time that is not earlier than
// when this log group was created.
// this time are not exported.
//
// You must specify a time that is not earlier than when this log group was
// created.
//
// This member is required.
To *int64
// The prefix used as the start of the key for every object exported. If you don't
// specify a value, the default is exportedlogs .
//
// The length of this parameter must comply with the S3 object key name length
// limits. The object key name is a sequence of Unicode characters with UTF-8
// encoding, and can be up to 1,024 bytes.
DestinationPrefix *string
// Export only log streams that match the provided prefix. If you don't specify a
@@ -119,25 +137,28 @@ func (c *Client) addOperationCreateExportTaskMiddlewares(stack *middleware.Stack
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -152,13 +173,22 @@ func (c *Client) addOperationCreateExportTaskMiddlewares(stack *middleware.Stack
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpCreateExportTaskValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateExportTask(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -173,6 +203,48 @@ func (c *Client) addOperationCreateExportTaskMiddlewares(stack *middleware.Stack
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,31 +6,41 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an anomaly detector that regularly scans one or more log groups and
// look for patterns and anomalies in the logs. An anomaly detector can help
// surface issues by automatically discovering anomalies in your log event traffic.
// An anomaly detector uses machine learning algorithms to scan log events and find
// patterns. A pattern is a shared text structure that recurs among your log
// fields. Patterns provide a useful tool for analyzing large sets of logs because
// a large number of log events can often be compressed into a few patterns. The
// anomaly detector uses pattern recognition to find anomalies , which are unusual
// log events. It uses the evaluationFrequency to compare current log events and
// patterns with trained baselines. Fields within a pattern are called tokens.
// Fields that vary within a pattern, such as a request ID or timestamp, are
// referred to as dynamic tokens and represented by <> . The following is an
// example of a pattern: [INFO] Request time: < > ms This pattern represents log
// events like [INFO] Request time: 327 ms and other similar log events that
// differ only by the number, in this csse 327. When the pattern is displayed, the
// different numbers are replaced by <*> Any parts of log events that are masked
// as sensitive data are not scanned for anomalies. For more information about
// masking sensitive data, see Help protect sensitive log data with masking (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html)
// .
// look for patterns and anomalies in the logs.
//
// An anomaly detector can help surface issues by automatically discovering
// anomalies in your log event traffic. An anomaly detector uses machine learning
// algorithms to scan log events and find patterns. A pattern is a shared text
// structure that recurs among your log fields. Patterns provide a useful tool for
// analyzing large sets of logs because a large number of log events can often be
// compressed into a few patterns.
//
// The anomaly detector uses pattern recognition to find anomalies , which are
// unusual log events. It uses the evaluationFrequency to compare current log
// events and patterns with trained baselines.
//
// Fields within a pattern are called tokens. Fields that vary within a pattern,
// such as a request ID or timestamp, are referred to as dynamic tokens and
// represented by <*> .
//
// The following is an example of a pattern:
//
// [INFO] Request time: <*> ms
//
// This pattern represents log events like [INFO] Request time: 327 ms and other
// similar log events that differ only by the number, in this csse 327. When the
// pattern is displayed, the different numbers are replaced by <*>
//
// Any parts of log events that are masked as sensitive data are not scanned for
// anomalies. For more information about masking sensitive data, see [Help protect sensitive log data with masking].
//
// [Help protect sensitive log data with masking]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html
func (c *Client) CreateLogAnomalyDetector(ctx context.Context, params *CreateLogAnomalyDetectorInput, optFns ...func(*Options)) (*CreateLogAnomalyDetectorOutput, error) {
if params == nil {
params = &CreateLogAnomalyDetectorInput{}
@@ -72,23 +82,28 @@ type CreateLogAnomalyDetectorInput struct {
EvaluationFrequency types.EvaluationFrequency
// You can use this parameter to limit the anomaly detection model to examine only
// log events that match the pattern you specify here. For more information, see
// Filter and Pattern Syntax (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html)
// .
// log events that match the pattern you specify here. For more information, see [Filter and Pattern Syntax].
//
// [Filter and Pattern Syntax]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html
FilterPattern *string
// Optionally assigns a KMS key to secure this anomaly detector and its findings.
// If a key is assigned, the anomalies found and the model used by this detector
// are encrypted at rest with the key. If a key is assigned to an anomaly detector,
// a user must have permissions for both this key and for the anomaly detector to
// retrieve information about the anomalies that it finds. For more information
// about using a KMS key and to see the required IAM policy, see Use a KMS key
// with an anomaly detector (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/LogsAnomalyDetection-KMS.html)
// .
// retrieve information about the anomalies that it finds.
//
// Make sure the value provided is a valid KMS key ARN. For more information about
// using a KMS key and to see the required IAM policy, see [Use a KMS key with an anomaly detector].
//
// [Use a KMS key with an anomaly detector]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/LogsAnomalyDetection-KMS.html
KmsKeyId *string
// An optional list of key-value pairs to associate with the resource. For more
// information about tagging, see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// An optional list of key-value pairs to associate with the resource.
//
// For more information about tagging, see [Tagging Amazon Web Services resources]
//
// [Tagging Amazon Web Services resources]: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
Tags map[string]string
noSmithyDocumentSerde
@@ -127,25 +142,28 @@ func (c *Client) addOperationCreateLogAnomalyDetectorMiddlewares(stack *middlewa
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -160,13 +178,22 @@ func (c *Client) addOperationCreateLogAnomalyDetectorMiddlewares(stack *middlewa
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpCreateLogAnomalyDetectorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLogAnomalyDetector(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -181,6 +208,48 @@ func (c *Client) addOperationCreateLogAnomalyDetectorMiddlewares(stack *middlewa
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,35 +6,45 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a log group with the specified name. You can create up to 1,000,000 log
// groups per Region per account. You must use the following guidelines when naming
// a log group:
// groups per Region per account.
//
// You must use the following guidelines when naming a log group:
//
// - Log group names must be unique within a Region for an Amazon Web Services
// account.
//
// - Log group names can be between 1 and 512 characters long.
//
// - Log group names consist of the following characters: a-z, A-Z, 0-9, '_'
// (underscore), '-' (hyphen), '/' (forward slash), '.' (period), and '#' (number
// sign)
//
// - Log group names can't start with the string aws/
//
// When you create a log group, by default the log events in the log group do not
// expire. To set a retention policy so that events expire and are deleted after a
// specified time, use PutRetentionPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutRetentionPolicy.html)
// . If you associate an KMS key with the log group, ingested data is encrypted
// specified time, use [PutRetentionPolicy].
//
// If you associate an KMS key with the log group, ingested data is encrypted
// using the KMS key. This association is stored as long as the data encrypted with
// the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs to
// decrypt this data whenever it is requested. If you attempt to associate a KMS
// key with the log group but the KMS key does not exist or the KMS key is
// disabled, you receive an InvalidParameterException error. CloudWatch Logs
// supports only symmetric KMS keys. Do not associate an asymmetric KMS key with
// your log group. For more information, see Using Symmetric and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
// .
// decrypt this data whenever it is requested.
//
// If you attempt to associate a KMS key with the log group but the KMS key does
// not exist or the KMS key is disabled, you receive an InvalidParameterException
// error.
//
// CloudWatch Logs supports only symmetric KMS keys. Do not associate an
// asymmetric KMS key with your log group. For more information, see [Using Symmetric and Asymmetric Keys].
//
// [Using Symmetric and Asymmetric Keys]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
// [PutRetentionPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutRetentionPolicy.html
func (c *Client) CreateLogGroup(ctx context.Context, params *CreateLogGroupInput, optFns ...func(*Options)) (*CreateLogGroupOutput, error) {
if params == nil {
params = &CreateLogGroupInput{}
@@ -58,29 +68,44 @@ type CreateLogGroupInput struct {
LogGroupName *string
// The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data.
// For more information, see Amazon Resource Names (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms)
// .
// For more information, see [Amazon Resource Names].
//
// [Amazon Resource Names]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms
KmsKeyId *string
// Use this parameter to specify the log group class for this log group. There are
// two classes:
// three classes:
//
// - The Standard log class supports all CloudWatch Logs features.
//
// - The Infrequent Access log class supports a subset of CloudWatch Logs
// features and incurs lower costs.
// If you omit this parameter, the default of STANDARD is used. The value of
// logGroupClass can't be changed after a log group is created. For details about
// the features supported by each class, see Log classes (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html)
//
// - Use the Delivery log class only for delivering Lambda logs to store in
// Amazon S3 or Amazon Data Firehose. Log events in log groups in the Delivery
// class are kept in CloudWatch Logs for only one day. This log class doesn't offer
// rich CloudWatch Logs capabilities such as CloudWatch Logs Insights queries.
//
// If you omit this parameter, the default of STANDARD is used.
//
// The value of logGroupClass can't be changed after a log group is created.
//
// For details about the features supported by each class, see [Log classes]
//
// [Log classes]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html
LogGroupClass types.LogGroupClass
// The key-value pairs to use for the tags. You can grant users access to certain
// log groups while preventing them from accessing other log groups. To do so, tag
// your groups and use IAM policies that refer to those tags. To assign tags when
// you create a log group, you must have either the logs:TagResource or
// logs:TagLogGroup permission. For more information about tagging, see Tagging
// Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)
// . For more information about using tags to control access, see Controlling
// access to Amazon Web Services resources using tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html)
// .
// The key-value pairs to use for the tags.
//
// You can grant users access to certain log groups while preventing them from
// accessing other log groups. To do so, tag your groups and use IAM policies that
// refer to those tags. To assign tags when you create a log group, you must have
// either the logs:TagResource or logs:TagLogGroup permission. For more
// information about tagging, see [Tagging Amazon Web Services resources]. For more information about using tags to
// control access, see [Controlling access to Amazon Web Services resources using tags].
//
// [Controlling access to Amazon Web Services resources using tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html
// [Tagging Amazon Web Services resources]: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
Tags map[string]string
noSmithyDocumentSerde
@@ -115,25 +140,28 @@ func (c *Client) addOperationCreateLogGroupMiddlewares(stack *middleware.Stack,
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -148,13 +176,22 @@ func (c *Client) addOperationCreateLogGroupMiddlewares(stack *middleware.Stack,
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpCreateLogGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLogGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -169,6 +206,48 @@ func (c *Client) addOperationCreateLogGroupMiddlewares(stack *middleware.Stack,
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,19 +6,24 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a log stream for the specified log group. A log stream is a sequence of
// log events that originate from a single source, such as an application instance
// or a resource that is being monitored. There is no limit on the number of log
// streams that you can create for a log group. There is a limit of 50 TPS on
// CreateLogStream operations, after which transactions are throttled. You must use
// the following guidelines when naming a log stream:
// or a resource that is being monitored.
//
// There is no limit on the number of log streams that you can create for a log
// group. There is a limit of 50 TPS on CreateLogStream operations, after which
// transactions are throttled.
//
// You must use the following guidelines when naming a log stream:
//
// - Log stream names must be unique within the log group.
//
// - Log stream names can be between 1 and 512 characters long.
//
// - Don't use ':' (colon) or '*' (asterisk) characters.
func (c *Client) CreateLogStream(ctx context.Context, params *CreateLogStreamInput, optFns ...func(*Options)) (*CreateLogStreamOutput, error) {
if params == nil {
@@ -79,25 +84,28 @@ func (c *Client) addOperationCreateLogStreamMiddlewares(stack *middleware.Stack,
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -112,13 +120,22 @@ func (c *Client) addOperationCreateLogStreamMiddlewares(stack *middleware.Stack,
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpCreateLogStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLogStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -133,6 +150,48 @@ func (c *Client) addOperationCreateLogStreamMiddlewares(stack *middleware.Stack,
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,21 +6,34 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a CloudWatch Logs account policy. This stops the policy from applying
// to all log groups or a subset of log groups in the account. Log-group level
// policies will still be in effect. To use this operation, you must be signed on
// with the correct permissions depending on the type of policy that you are
// deleting.
// Deletes a CloudWatch Logs account policy. This stops the account-wide policy
// from applying to log groups in the account. If you delete a data protection
// policy or subscription filter policy, any log-group level policies of those
// types remain in effect.
//
// To use this operation, you must be signed on with the correct permissions
// depending on the type of policy that you are deleting.
//
// - To delete a data protection policy, you must have the
// logs:DeleteDataProtectionPolicy and logs:DeleteAccountPolicy permissions.
//
// - To delete a subscription filter policy, you must have the
// logs:DeleteSubscriptionFilter and logs:DeleteAccountPolicy permissions.
//
// - To delete a transformer policy, you must have the logs:DeleteTransformer and
// logs:DeleteAccountPolicy permissions.
//
// - To delete a field index policy, you must have the logs:DeleteIndexPolicy and
// logs:DeleteAccountPolicy permissions.
//
// If you delete a field index policy, the indexing of the log events that
// happened before you deleted the policy will still be used for up to 30 days to
// improve CloudWatch Logs Insights queries.
func (c *Client) DeleteAccountPolicy(ctx context.Context, params *DeleteAccountPolicyInput, optFns ...func(*Options)) (*DeleteAccountPolicyOutput, error) {
if params == nil {
params = &DeleteAccountPolicyInput{}
@@ -80,25 +93,28 @@ func (c *Client) addOperationDeleteAccountPolicyMiddlewares(stack *middleware.St
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -113,13 +129,22 @@ func (c *Client) addOperationDeleteAccountPolicyMiddlewares(stack *middleware.St
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteAccountPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccountPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -134,6 +159,48 @@ func (c *Client) addOperationDeleteAccountPolicyMiddlewares(stack *middleware.St
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,14 +6,15 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the data protection policy from the specified log group. For more
// information about data protection policies, see PutDataProtectionPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDataProtectionPolicy.html)
// .
// Deletes the data protection policy from the specified log group.
//
// For more information about data protection policies, see [PutDataProtectionPolicy].
//
// [PutDataProtectionPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDataProtectionPolicy.html
func (c *Client) DeleteDataProtectionPolicy(ctx context.Context, params *DeleteDataProtectionPolicyInput, optFns ...func(*Options)) (*DeleteDataProtectionPolicyOutput, error) {
if params == nil {
params = &DeleteDataProtectionPolicyInput{}
@@ -69,25 +70,28 @@ func (c *Client) addOperationDeleteDataProtectionPolicyMiddlewares(stack *middle
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -102,13 +106,22 @@ func (c *Client) addOperationDeleteDataProtectionPolicyMiddlewares(stack *middle
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteDataProtectionPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDataProtectionPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -123,6 +136,48 @@ func (c *Client) addOperationDeleteDataProtectionPolicyMiddlewares(stack *middle
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,12 +6,11 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes s delivery. A delivery is a connection between a logical delivery
// Deletes a delivery. A delivery is a connection between a logical delivery
// source and a logical delivery destination. Deleting a delivery only deletes the
// connection between the delivery source and delivery destination. It does not
// delete the delivery destination or the delivery source.
@@ -33,8 +32,9 @@ func (c *Client) DeleteDelivery(ctx context.Context, params *DeleteDeliveryInput
type DeleteDeliveryInput struct {
// The unique ID of the delivery to delete. You can find the ID of a delivery with
// the DescribeDeliveries (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html)
// operation.
// the [DescribeDeliveries]operation.
//
// [DescribeDeliveries]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html
//
// This member is required.
Id *string
@@ -71,25 +71,28 @@ func (c *Client) addOperationDeleteDeliveryMiddlewares(stack *middleware.Stack,
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -104,13 +107,22 @@ func (c *Client) addOperationDeleteDeliveryMiddlewares(stack *middleware.Stack,
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteDeliveryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDelivery(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -125,6 +137,48 @@ func (c *Client) addOperationDeleteDeliveryMiddlewares(stack *middleware.Stack,
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,17 +6,19 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a delivery destination. A delivery is a connection between a logical
// delivery source and a logical delivery destination. You can't delete a delivery
// destination if any current deliveries are associated with it. To find whether
// any deliveries are associated with this delivery destination, use the
// DescribeDeliveries (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html)
// operation and check the deliveryDestinationArn field in the results.
// delivery source and a logical delivery destination.
//
// You can't delete a delivery destination if any current deliveries are
// associated with it. To find whether any deliveries are associated with this
// delivery destination, use the [DescribeDeliveries]operation and check the deliveryDestinationArn
// field in the results.
//
// [DescribeDeliveries]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html
func (c *Client) DeleteDeliveryDestination(ctx context.Context, params *DeleteDeliveryDestinationInput, optFns ...func(*Options)) (*DeleteDeliveryDestinationOutput, error) {
if params == nil {
params = &DeleteDeliveryDestinationInput{}
@@ -35,8 +37,9 @@ func (c *Client) DeleteDeliveryDestination(ctx context.Context, params *DeleteDe
type DeleteDeliveryDestinationInput struct {
// The name of the delivery destination that you want to delete. You can find a
// list of delivery destionation names by using the DescribeDeliveryDestinations (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveryDestinations.html)
// operation.
// list of delivery destination names by using the [DescribeDeliveryDestinations]operation.
//
// [DescribeDeliveryDestinations]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveryDestinations.html
//
// This member is required.
Name *string
@@ -73,25 +76,28 @@ func (c *Client) addOperationDeleteDeliveryDestinationMiddlewares(stack *middlew
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -106,13 +112,22 @@ func (c *Client) addOperationDeleteDeliveryDestinationMiddlewares(stack *middlew
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteDeliveryDestinationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDeliveryDestination(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -127,6 +142,48 @@ func (c *Client) addOperationDeleteDeliveryDestinationMiddlewares(stack *middlew
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,14 +6,14 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a delivery destination policy. For more information about these
// policies, see PutDeliveryDestinationPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html)
// .
// policies, see [PutDeliveryDestinationPolicy].
//
// [PutDeliveryDestinationPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html
func (c *Client) DeleteDeliveryDestinationPolicy(ctx context.Context, params *DeleteDeliveryDestinationPolicyInput, optFns ...func(*Options)) (*DeleteDeliveryDestinationPolicyOutput, error) {
if params == nil {
params = &DeleteDeliveryDestinationPolicyInput{}
@@ -68,25 +68,28 @@ func (c *Client) addOperationDeleteDeliveryDestinationPolicyMiddlewares(stack *m
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -101,13 +104,22 @@ func (c *Client) addOperationDeleteDeliveryDestinationPolicyMiddlewares(stack *m
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteDeliveryDestinationPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDeliveryDestinationPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -122,6 +134,48 @@ func (c *Client) addOperationDeleteDeliveryDestinationPolicyMiddlewares(stack *m
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,16 +6,18 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a delivery source. A delivery is a connection between a logical
// delivery source and a logical delivery destination. You can't delete a delivery
// source if any current deliveries are associated with it. To find whether any
// deliveries are associated with this delivery source, use the DescribeDeliveries (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html)
// operation and check the deliverySourceName field in the results.
// delivery source and a logical delivery destination.
//
// You can't delete a delivery source if any current deliveries are associated
// with it. To find whether any deliveries are associated with this delivery
// source, use the [DescribeDeliveries]operation and check the deliverySourceName field in the results.
//
// [DescribeDeliveries]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html
func (c *Client) DeleteDeliverySource(ctx context.Context, params *DeleteDeliverySourceInput, optFns ...func(*Options)) (*DeleteDeliverySourceOutput, error) {
if params == nil {
params = &DeleteDeliverySourceInput{}
@@ -70,25 +72,28 @@ func (c *Client) addOperationDeleteDeliverySourceMiddlewares(stack *middleware.S
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -103,13 +108,22 @@ func (c *Client) addOperationDeleteDeliverySourceMiddlewares(stack *middleware.S
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteDeliverySourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDeliverySource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -124,6 +138,48 @@ func (c *Client) addOperationDeleteDeliverySourceMiddlewares(stack *middleware.S
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -68,25 +67,28 @@ func (c *Client) addOperationDeleteDestinationMiddlewares(stack *middleware.Stac
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -101,13 +103,22 @@ func (c *Client) addOperationDeleteDestinationMiddlewares(stack *middleware.Stac
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteDestinationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDestination(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -122,6 +133,48 @@ func (c *Client) addOperationDeleteDestinationMiddlewares(stack *middleware.Stac
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,198 @@
// Code generated by smithy-go-codegen DO NOT EDIT.
package cloudwatchlogs
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a log-group level field index policy that was applied to a single log
// group. The indexing of the log events that happened before you delete the policy
// will still be used for as many as 30 days to improve CloudWatch Logs Insights
// queries.
//
// You can't use this operation to delete an account-level index policy. Instead,
// use [DeletAccountPolicy].
//
// If you delete a log-group level field index policy and there is an
// account-level field index policy, in a few minutes the log group begins using
// that account-wide policy to index new incoming log events.
//
// [DeletAccountPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteAccountPolicy.html
func (c *Client) DeleteIndexPolicy(ctx context.Context, params *DeleteIndexPolicyInput, optFns ...func(*Options)) (*DeleteIndexPolicyOutput, error) {
if params == nil {
params = &DeleteIndexPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteIndexPolicy", params, optFns, c.addOperationDeleteIndexPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteIndexPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteIndexPolicyInput struct {
// The log group to delete the index policy for. You can specify either the name
// or the ARN of the log group.
//
// This member is required.
LogGroupIdentifier *string
noSmithyDocumentSerde
}
type DeleteIndexPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteIndexPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteIndexPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteIndexPolicy{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIndexPolicy"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteIndexPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIndexPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteIndexPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "DeleteIndexPolicy",
}
}

View File

@@ -0,0 +1,199 @@
// Code generated by smithy-go-codegen DO NOT EDIT.
package cloudwatchlogs
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the integration between CloudWatch Logs and OpenSearch Service. If your
// integration has active vended logs dashboards, you must specify true for the
// force parameter, otherwise the operation will fail. If you delete the
// integration by setting force to true , all your vended logs dashboards powered
// by OpenSearch Service will be deleted and the data that was on them will no
// longer be accessible.
func (c *Client) DeleteIntegration(ctx context.Context, params *DeleteIntegrationInput, optFns ...func(*Options)) (*DeleteIntegrationOutput, error) {
if params == nil {
params = &DeleteIntegrationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteIntegration", params, optFns, c.addOperationDeleteIntegrationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteIntegrationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteIntegrationInput struct {
// The name of the integration to delete. To find the name of your integration,
// use [ListIntegrations].
//
// [ListIntegrations]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListIntegrations.html
//
// This member is required.
IntegrationName *string
// Specify true to force the deletion of the integration even if vended logs
// dashboards currently exist.
//
// The default is false .
Force bool
noSmithyDocumentSerde
}
type DeleteIntegrationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteIntegration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteIntegration{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIntegration"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteIntegrationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIntegration(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteIntegration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "DeleteIntegration",
}
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -30,8 +29,9 @@ func (c *Client) DeleteLogAnomalyDetector(ctx context.Context, params *DeleteLog
type DeleteLogAnomalyDetectorInput struct {
// The ARN of the anomaly detector to delete. You can find the ARNs of log anomaly
// detectors in your account by using the ListLogAnomalyDetectors (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListLogAnomalyDetectors.html)
// operation.
// detectors in your account by using the [ListLogAnomalyDetectors]operation.
//
// [ListLogAnomalyDetectors]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListLogAnomalyDetectors.html
//
// This member is required.
AnomalyDetectorArn *string
@@ -68,25 +68,28 @@ func (c *Client) addOperationDeleteLogAnomalyDetectorMiddlewares(stack *middlewa
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -101,13 +104,22 @@ func (c *Client) addOperationDeleteLogAnomalyDetectorMiddlewares(stack *middlewa
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteLogAnomalyDetectorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLogAnomalyDetector(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -122,6 +134,48 @@ func (c *Client) addOperationDeleteLogAnomalyDetectorMiddlewares(stack *middlewa
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -67,25 +66,28 @@ func (c *Client) addOperationDeleteLogGroupMiddlewares(stack *middleware.Stack,
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -100,13 +102,22 @@ func (c *Client) addOperationDeleteLogGroupMiddlewares(stack *middleware.Stack,
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteLogGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLogGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -121,6 +132,48 @@ func (c *Client) addOperationDeleteLogGroupMiddlewares(stack *middleware.Stack,
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -72,25 +71,28 @@ func (c *Client) addOperationDeleteLogStreamMiddlewares(stack *middleware.Stack,
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -105,13 +107,22 @@ func (c *Client) addOperationDeleteLogStreamMiddlewares(stack *middleware.Stack,
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteLogStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLogStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -126,6 +137,48 @@ func (c *Client) addOperationDeleteLogStreamMiddlewares(stack *middleware.Stack,
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -71,25 +70,28 @@ func (c *Client) addOperationDeleteMetricFilterMiddlewares(stack *middleware.Sta
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -104,13 +106,22 @@ func (c *Client) addOperationDeleteMetricFilterMiddlewares(stack *middleware.Sta
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteMetricFilterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMetricFilter(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -125,6 +136,48 @@ func (c *Client) addOperationDeleteMetricFilterMiddlewares(stack *middleware.Sta
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,15 +6,17 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a saved CloudWatch Logs Insights query definition. A query definition
// contains details about a saved CloudWatch Logs Insights query. Each
// DeleteQueryDefinition operation can delete one query definition. You must have
// the logs:DeleteQueryDefinition permission to be able to perform this operation.
// contains details about a saved CloudWatch Logs Insights query.
//
// Each DeleteQueryDefinition operation can delete one query definition.
//
// You must have the logs:DeleteQueryDefinition permission to be able to perform
// this operation.
func (c *Client) DeleteQueryDefinition(ctx context.Context, params *DeleteQueryDefinitionInput, optFns ...func(*Options)) (*DeleteQueryDefinitionOutput, error) {
if params == nil {
params = &DeleteQueryDefinitionInput{}
@@ -32,9 +34,10 @@ func (c *Client) DeleteQueryDefinition(ctx context.Context, params *DeleteQueryD
type DeleteQueryDefinitionInput struct {
// The ID of the query definition that you want to delete. You can use
// DescribeQueryDefinitions (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeQueryDefinitions.html)
// to retrieve the IDs of your saved query definitions.
// The ID of the query definition that you want to delete. You can use [DescribeQueryDefinitions] to
// retrieve the IDs of your saved query definitions.
//
// [DescribeQueryDefinitions]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeQueryDefinitions.html
//
// This member is required.
QueryDefinitionId *string
@@ -76,25 +79,28 @@ func (c *Client) addOperationDeleteQueryDefinitionMiddlewares(stack *middleware.
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -109,13 +115,22 @@ func (c *Client) addOperationDeleteQueryDefinitionMiddlewares(stack *middleware.
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteQueryDefinitionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteQueryDefinition(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -130,6 +145,48 @@ func (c *Client) addOperationDeleteQueryDefinitionMiddlewares(stack *middleware.
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -30,9 +29,17 @@ func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourc
type DeleteResourcePolicyInput struct {
// The expected revision ID of the resource policy. Required when deleting a
// resource-scoped policy to prevent concurrent modifications.
ExpectedRevisionId *string
// The name of the policy to be revoked. This parameter is required.
PolicyName *string
// The ARN of the CloudWatch Logs resource for which the resource policy needs to
// be deleted
ResourceArn *string
noSmithyDocumentSerde
}
@@ -65,25 +72,28 @@ func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.S
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -98,10 +108,19 @@ func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.S
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -116,6 +135,48 @@ func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.S
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,13 +6,14 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified retention policy. Log events do not expire if they belong
// to log groups without a retention policy.
// Deletes the specified retention policy.
//
// Log events do not expire if they belong to log groups without a retention
// policy.
func (c *Client) DeleteRetentionPolicy(ctx context.Context, params *DeleteRetentionPolicyInput, optFns ...func(*Options)) (*DeleteRetentionPolicyOutput, error) {
if params == nil {
params = &DeleteRetentionPolicyInput{}
@@ -67,25 +68,28 @@ func (c *Client) addOperationDeleteRetentionPolicyMiddlewares(stack *middleware.
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -100,13 +104,22 @@ func (c *Client) addOperationDeleteRetentionPolicyMiddlewares(stack *middleware.
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteRetentionPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRetentionPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -121,6 +134,48 @@ func (c *Client) addOperationDeleteRetentionPolicyMiddlewares(stack *middleware.
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -71,25 +70,28 @@ func (c *Client) addOperationDeleteSubscriptionFilterMiddlewares(stack *middlewa
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -104,13 +106,22 @@ func (c *Client) addOperationDeleteSubscriptionFilterMiddlewares(stack *middlewa
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteSubscriptionFilterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSubscriptionFilter(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -125,6 +136,48 @@ func (c *Client) addOperationDeleteSubscriptionFilterMiddlewares(stack *middlewa
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,194 @@
// Code generated by smithy-go-codegen DO NOT EDIT.
package cloudwatchlogs
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the log transformer for the specified log group. As soon as you do
// this, the transformation of incoming log events according to that transformer
// stops. If this account has an account-level transformer that applies to this log
// group, the log group begins using that account-level transformer when this
// log-group level transformer is deleted.
//
// After you delete a transformer, be sure to edit any metric filters or
// subscription filters that relied on the transformed versions of the log events.
func (c *Client) DeleteTransformer(ctx context.Context, params *DeleteTransformerInput, optFns ...func(*Options)) (*DeleteTransformerOutput, error) {
if params == nil {
params = &DeleteTransformerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteTransformer", params, optFns, c.addOperationDeleteTransformerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteTransformerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteTransformerInput struct {
// Specify either the name or ARN of the log group to delete the transformer for.
// If the log group is in a source account and you are using a monitoring account,
// you must use the log group ARN.
//
// This member is required.
LogGroupIdentifier *string
noSmithyDocumentSerde
}
type DeleteTransformerOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteTransformerMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteTransformer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteTransformer{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransformer"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDeleteTransformerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransformer(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteTransformer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "DeleteTransformer",
}
}

View File

@@ -6,13 +6,27 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of all CloudWatch Logs account policies in the account.
//
// To use this operation, you must be signed on with the correct permissions
// depending on the type of policy that you are retrieving information for.
//
// - To see data protection policies, you must have the
// logs:GetDataProtectionPolicy and logs:DescribeAccountPolicies permissions.
//
// - To see subscription filter policies, you must have the
// logs:DescribeSubscriptionFilters and logs:DescribeAccountPolicies permissions.
//
// - To see transformer policies, you must have the logs:GetTransformer and
// logs:DescribeAccountPolicies permissions.
//
// - To see field index policies, you must have the logs:DescribeIndexPolicies
// and logs:DescribeAccountPolicies permissions.
func (c *Client) DescribeAccountPolicies(ctx context.Context, params *DescribeAccountPoliciesInput, optFns ...func(*Options)) (*DescribeAccountPoliciesOutput, error) {
if params == nil {
params = &DescribeAccountPoliciesInput{}
@@ -40,10 +54,15 @@ type DescribeAccountPoliciesInput struct {
// CloudWatch unified cross-account observability, you can use this to specify the
// account ID of a source account. If you do, the operation returns the account
// policy for the specified account. Currently, you can specify only one account ID
// in this parameter. If you omit this parameter, only the policy in the current
// account is returned.
// in this parameter.
//
// If you omit this parameter, only the policy in the current account is returned.
AccountIdentifiers []string
// The token for the next set of items to return. (You received this token from a
// previous call.)
NextToken *string
// Use this parameter to limit the returned policies to only the policy with the
// name that you specify.
PolicyName *string
@@ -57,6 +76,10 @@ type DescribeAccountPoliciesOutput struct {
// account policies that match the specified filters.
AccountPolicies []types.AccountPolicy
// The token to use when requesting the next set of items. The token expires after
// 24 hours.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
@@ -85,25 +108,28 @@ func (c *Client) addOperationDescribeAccountPoliciesMiddlewares(stack *middlewar
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -118,13 +144,22 @@ func (c *Client) addOperationDescribeAccountPoliciesMiddlewares(stack *middlewar
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDescribeAccountPoliciesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAccountPolicies(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -139,6 +174,48 @@ func (c *Client) addOperationDescribeAccountPoliciesMiddlewares(stack *middlewar
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,310 @@
// Code generated by smithy-go-codegen DO NOT EDIT.
package cloudwatchlogs
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Use this operation to return the valid and default values that are used when
// creating delivery sources, delivery destinations, and deliveries. For more
// information about deliveries, see [CreateDelivery].
//
// [CreateDelivery]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html
func (c *Client) DescribeConfigurationTemplates(ctx context.Context, params *DescribeConfigurationTemplatesInput, optFns ...func(*Options)) (*DescribeConfigurationTemplatesOutput, error) {
if params == nil {
params = &DescribeConfigurationTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeConfigurationTemplates", params, optFns, c.addOperationDescribeConfigurationTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeConfigurationTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeConfigurationTemplatesInput struct {
// Use this parameter to filter the response to include only the configuration
// templates that apply to the delivery destination types that you specify here.
DeliveryDestinationTypes []types.DeliveryDestinationType
// Use this parameter to limit the number of configuration templates that are
// returned in the response.
Limit *int32
// Use this parameter to filter the response to include only the configuration
// templates that apply to the log types that you specify here.
LogTypes []string
// The token for the next set of items to return. The token expires after 24 hours.
NextToken *string
// Use this parameter to filter the response to include only the configuration
// templates that apply to the resource types that you specify here.
ResourceTypes []string
// Use this parameter to filter the response to include only the configuration
// templates that apply to the Amazon Web Services service that you specify here.
Service *string
noSmithyDocumentSerde
}
type DescribeConfigurationTemplatesOutput struct {
// An array of objects, where each object describes one configuration template
// that matches the filters that you specified in the request.
ConfigurationTemplates []types.ConfigurationTemplate
// The token for the next set of items to return. The token expires after 24 hours.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeConfigurationTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeConfigurationTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeConfigurationTemplates{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeConfigurationTemplates"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeConfigurationTemplates(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// DescribeConfigurationTemplatesPaginatorOptions is the paginator options for
// DescribeConfigurationTemplates
type DescribeConfigurationTemplatesPaginatorOptions struct {
// Use this parameter to limit the number of configuration templates that are
// returned in the response.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// DescribeConfigurationTemplatesPaginator is a paginator for
// DescribeConfigurationTemplates
type DescribeConfigurationTemplatesPaginator struct {
options DescribeConfigurationTemplatesPaginatorOptions
client DescribeConfigurationTemplatesAPIClient
params *DescribeConfigurationTemplatesInput
nextToken *string
firstPage bool
}
// NewDescribeConfigurationTemplatesPaginator returns a new
// DescribeConfigurationTemplatesPaginator
func NewDescribeConfigurationTemplatesPaginator(client DescribeConfigurationTemplatesAPIClient, params *DescribeConfigurationTemplatesInput, optFns ...func(*DescribeConfigurationTemplatesPaginatorOptions)) *DescribeConfigurationTemplatesPaginator {
if params == nil {
params = &DescribeConfigurationTemplatesInput{}
}
options := DescribeConfigurationTemplatesPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &DescribeConfigurationTemplatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *DescribeConfigurationTemplatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next DescribeConfigurationTemplates page.
func (p *DescribeConfigurationTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeConfigurationTemplatesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.DescribeConfigurationTemplates(ctx, &params, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
// DescribeConfigurationTemplatesAPIClient is a client that implements the
// DescribeConfigurationTemplates operation.
type DescribeConfigurationTemplatesAPIClient interface {
DescribeConfigurationTemplates(context.Context, *DescribeConfigurationTemplatesInput, ...func(*Options)) (*DescribeConfigurationTemplatesOutput, error)
}
var _ DescribeConfigurationTemplatesAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opDescribeConfigurationTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "DescribeConfigurationTemplates",
}
}

View File

@@ -6,20 +6,23 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a list of the deliveries that have been created in the account. A
// delivery is a connection between a delivery source (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html)
// and a delivery destination (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html)
// . A delivery source represents an Amazon Web Services resource that sends logs
// to an logs delivery destination. The destination can be CloudWatch Logs, Amazon
// S3, or Kinesis Data Firehose. Only some Amazon Web Services services support
// being configured as a delivery source. These services are listed in Enable
// logging from Amazon Web Services services. (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html)
// Retrieves a list of the deliveries that have been created in the account.
//
// A delivery is a connection between a [delivery source] and a [delivery destination].
//
// A delivery source represents an Amazon Web Services resource that sends logs to
// an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3,
// Firehose or X-Ray. Only some Amazon Web Services services support being
// configured as a delivery source. These services are listed in [Enable logging from Amazon Web Services services.]
//
// [delivery destination]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html
// [delivery source]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html
// [Enable logging from Amazon Web Services services.]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html
func (c *Client) DescribeDeliveries(ctx context.Context, params *DescribeDeliveriesInput, optFns ...func(*Options)) (*DescribeDeliveriesOutput, error) {
if params == nil {
params = &DescribeDeliveriesInput{}
@@ -83,25 +86,28 @@ func (c *Client) addOperationDescribeDeliveriesMiddlewares(stack *middleware.Sta
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -116,10 +122,19 @@ func (c *Client) addOperationDescribeDeliveriesMiddlewares(stack *middleware.Sta
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDeliveries(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -134,17 +149,51 @@ func (c *Client) addOperationDescribeDeliveriesMiddlewares(stack *middleware.Sta
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// DescribeDeliveriesAPIClient is a client that implements the DescribeDeliveries
// operation.
type DescribeDeliveriesAPIClient interface {
DescribeDeliveries(context.Context, *DescribeDeliveriesInput, ...func(*Options)) (*DescribeDeliveriesOutput, error)
}
var _ DescribeDeliveriesAPIClient = (*Client)(nil)
// DescribeDeliveriesPaginatorOptions is the paginator options for
// DescribeDeliveries
type DescribeDeliveriesPaginatorOptions struct {
@@ -209,6 +258,9 @@ func (p *DescribeDeliveriesPaginator) NextPage(ctx context.Context, optFns ...fu
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.DescribeDeliveries(ctx, &params, optFns...)
if err != nil {
return nil, err
@@ -228,6 +280,14 @@ func (p *DescribeDeliveriesPaginator) NextPage(ctx context.Context, optFns ...fu
return result, nil
}
// DescribeDeliveriesAPIClient is a client that implements the DescribeDeliveries
// operation.
type DescribeDeliveriesAPIClient interface {
DescribeDeliveries(context.Context, *DescribeDeliveriesInput, ...func(*Options)) (*DescribeDeliveriesOutput, error)
}
var _ DescribeDeliveriesAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opDescribeDeliveries(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -78,25 +77,28 @@ func (c *Client) addOperationDescribeDeliveryDestinationsMiddlewares(stack *midd
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -111,10 +113,19 @@ func (c *Client) addOperationDescribeDeliveryDestinationsMiddlewares(stack *midd
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDeliveryDestinations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -129,17 +140,51 @@ func (c *Client) addOperationDescribeDeliveryDestinationsMiddlewares(stack *midd
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// DescribeDeliveryDestinationsAPIClient is a client that implements the
// DescribeDeliveryDestinations operation.
type DescribeDeliveryDestinationsAPIClient interface {
DescribeDeliveryDestinations(context.Context, *DescribeDeliveryDestinationsInput, ...func(*Options)) (*DescribeDeliveryDestinationsOutput, error)
}
var _ DescribeDeliveryDestinationsAPIClient = (*Client)(nil)
// DescribeDeliveryDestinationsPaginatorOptions is the paginator options for
// DescribeDeliveryDestinations
type DescribeDeliveryDestinationsPaginatorOptions struct {
@@ -207,6 +252,9 @@ func (p *DescribeDeliveryDestinationsPaginator) NextPage(ctx context.Context, op
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.DescribeDeliveryDestinations(ctx, &params, optFns...)
if err != nil {
return nil, err
@@ -226,6 +274,14 @@ func (p *DescribeDeliveryDestinationsPaginator) NextPage(ctx context.Context, op
return result, nil
}
// DescribeDeliveryDestinationsAPIClient is a client that implements the
// DescribeDeliveryDestinations operation.
type DescribeDeliveryDestinationsAPIClient interface {
DescribeDeliveryDestinations(context.Context, *DescribeDeliveryDestinationsInput, ...func(*Options)) (*DescribeDeliveryDestinationsOutput, error)
}
var _ DescribeDeliveryDestinationsAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opDescribeDeliveryDestinations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -77,25 +76,28 @@ func (c *Client) addOperationDescribeDeliverySourcesMiddlewares(stack *middlewar
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -110,10 +112,19 @@ func (c *Client) addOperationDescribeDeliverySourcesMiddlewares(stack *middlewar
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDeliverySources(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -128,17 +139,51 @@ func (c *Client) addOperationDescribeDeliverySourcesMiddlewares(stack *middlewar
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// DescribeDeliverySourcesAPIClient is a client that implements the
// DescribeDeliverySources operation.
type DescribeDeliverySourcesAPIClient interface {
DescribeDeliverySources(context.Context, *DescribeDeliverySourcesInput, ...func(*Options)) (*DescribeDeliverySourcesOutput, error)
}
var _ DescribeDeliverySourcesAPIClient = (*Client)(nil)
// DescribeDeliverySourcesPaginatorOptions is the paginator options for
// DescribeDeliverySources
type DescribeDeliverySourcesPaginatorOptions struct {
@@ -205,6 +250,9 @@ func (p *DescribeDeliverySourcesPaginator) NextPage(ctx context.Context, optFns
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.DescribeDeliverySources(ctx, &params, optFns...)
if err != nil {
return nil, err
@@ -224,6 +272,14 @@ func (p *DescribeDeliverySourcesPaginator) NextPage(ctx context.Context, optFns
return result, nil
}
// DescribeDeliverySourcesAPIClient is a client that implements the
// DescribeDeliverySources operation.
type DescribeDeliverySourcesAPIClient interface {
DescribeDeliverySources(context.Context, *DescribeDeliverySourcesInput, ...func(*Options)) (*DescribeDeliverySourcesOutput, error)
}
var _ DescribeDeliverySourcesAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opDescribeDeliverySources(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -80,25 +79,28 @@ func (c *Client) addOperationDescribeDestinationsMiddlewares(stack *middleware.S
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -113,10 +115,19 @@ func (c *Client) addOperationDescribeDestinationsMiddlewares(stack *middleware.S
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDestinations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -131,17 +142,51 @@ func (c *Client) addOperationDescribeDestinationsMiddlewares(stack *middleware.S
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// DescribeDestinationsAPIClient is a client that implements the
// DescribeDestinations operation.
type DescribeDestinationsAPIClient interface {
DescribeDestinations(context.Context, *DescribeDestinationsInput, ...func(*Options)) (*DescribeDestinationsOutput, error)
}
var _ DescribeDestinationsAPIClient = (*Client)(nil)
// DescribeDestinationsPaginatorOptions is the paginator options for
// DescribeDestinations
type DescribeDestinationsPaginatorOptions struct {
@@ -207,6 +252,9 @@ func (p *DescribeDestinationsPaginator) NextPage(ctx context.Context, optFns ...
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.DescribeDestinations(ctx, &params, optFns...)
if err != nil {
return nil, err
@@ -226,6 +274,14 @@ func (p *DescribeDestinationsPaginator) NextPage(ctx context.Context, optFns ...
return result, nil
}
// DescribeDestinationsAPIClient is a client that implements the
// DescribeDestinations operation.
type DescribeDestinationsAPIClient interface {
DescribeDestinations(context.Context, *DescribeDestinationsInput, ...func(*Options)) (*DescribeDestinationsOutput, error)
}
var _ DescribeDestinationsAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opDescribeDestinations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -86,25 +85,28 @@ func (c *Client) addOperationDescribeExportTasksMiddlewares(stack *middleware.St
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -119,10 +121,19 @@ func (c *Client) addOperationDescribeExportTasksMiddlewares(stack *middleware.St
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeExportTasks(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -137,6 +148,48 @@ func (c *Client) addOperationDescribeExportTasksMiddlewares(stack *middleware.St
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,200 @@
// Code generated by smithy-go-codegen DO NOT EDIT.
package cloudwatchlogs
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of custom and default field indexes which are discovered in log
// data. For more information about field index policies, see [PutIndexPolicy].
//
// [PutIndexPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html
func (c *Client) DescribeFieldIndexes(ctx context.Context, params *DescribeFieldIndexesInput, optFns ...func(*Options)) (*DescribeFieldIndexesOutput, error) {
if params == nil {
params = &DescribeFieldIndexesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeFieldIndexes", params, optFns, c.addOperationDescribeFieldIndexesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeFieldIndexesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeFieldIndexesInput struct {
// An array containing the names or ARNs of the log groups that you want to
// retrieve field indexes for.
//
// This member is required.
LogGroupIdentifiers []string
// The token for the next set of items to return. The token expires after 24 hours.
NextToken *string
noSmithyDocumentSerde
}
type DescribeFieldIndexesOutput struct {
// An array containing the field index information.
FieldIndexes []types.FieldIndex
// The token for the next set of items to return. The token expires after 24 hours.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeFieldIndexesMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeFieldIndexes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeFieldIndexes{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFieldIndexes"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDescribeFieldIndexesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFieldIndexes(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeFieldIndexes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "DescribeFieldIndexes",
}
}

View File

@@ -0,0 +1,210 @@
// Code generated by smithy-go-codegen DO NOT EDIT.
package cloudwatchlogs
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the field index policies of the specified log group. For more
// information about field index policies, see [PutIndexPolicy].
//
// If a specified log group has a log-group level index policy, that policy is
// returned by this operation.
//
// If a specified log group doesn't have a log-group level index policy, but an
// account-wide index policy applies to it, that account-wide policy is returned by
// this operation.
//
// To find information about only account-level policies, use [DescribeAccountPolicies] instead.
//
// [PutIndexPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html
// [DescribeAccountPolicies]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeAccountPolicies.html
func (c *Client) DescribeIndexPolicies(ctx context.Context, params *DescribeIndexPoliciesInput, optFns ...func(*Options)) (*DescribeIndexPoliciesOutput, error) {
if params == nil {
params = &DescribeIndexPoliciesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeIndexPolicies", params, optFns, c.addOperationDescribeIndexPoliciesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeIndexPoliciesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeIndexPoliciesInput struct {
// An array containing the name or ARN of the log group that you want to retrieve
// field index policies for.
//
// This member is required.
LogGroupIdentifiers []string
// The token for the next set of items to return. The token expires after 24 hours.
NextToken *string
noSmithyDocumentSerde
}
type DescribeIndexPoliciesOutput struct {
// An array containing the field index policies.
IndexPolicies []types.IndexPolicy
// The token for the next set of items to return. The token expires after 24 hours.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeIndexPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeIndexPolicies{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeIndexPolicies{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIndexPolicies"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDescribeIndexPoliciesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIndexPolicies(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeIndexPolicies(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "DescribeIndexPolicies",
}
}

View File

@@ -6,23 +6,26 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the specified log groups. You can list all your log groups or filter the
// results by prefix. The results are ASCII-sorted by log group name. CloudWatch
// Logs doesnt support IAM policies that control access to the DescribeLogGroups
// action by using the aws:ResourceTag/key-name condition key. Other CloudWatch
// Logs actions do support the use of the aws:ResourceTag/key-name condition key
// to control access. For more information about using tags to control access, see
// Controlling access to Amazon Web Services resources using tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html)
// . If you are using CloudWatch cross-account observability, you can use this
// Returns information about log groups. You can return all your log groups or
// filter the results by prefix. The results are ASCII-sorted by log group name.
//
// CloudWatch Logs doesn't support IAM policies that control access to the
// DescribeLogGroups action by using the aws:ResourceTag/key-name condition key.
// Other CloudWatch Logs actions do support the use of the
// aws:ResourceTag/key-name condition key to control access. For more information
// about using tags to control access, see [Controlling access to Amazon Web Services resources using tags].
//
// If you are using CloudWatch cross-account observability, you can use this
// operation in a monitoring account and view data from the linked source accounts.
// For more information, see CloudWatch cross-account observability (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html)
// .
// For more information, see [CloudWatch cross-account observability].
//
// [CloudWatch cross-account observability]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html
// [Controlling access to Amazon Web Services resources using tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html
func (c *Client) DescribeLogGroups(ctx context.Context, params *DescribeLogGroupsInput, optFns ...func(*Options)) (*DescribeLogGroupsOutput, error) {
if params == nil {
params = &DescribeLogGroupsInput{}
@@ -40,41 +43,74 @@ func (c *Client) DescribeLogGroups(ctx context.Context, params *DescribeLogGroup
type DescribeLogGroupsInput struct {
// When includeLinkedAccounts is set to True , use this parameter to specify the
// When includeLinkedAccounts is set to true , use this parameter to specify the
// list of accounts to search. You can specify as many as 20 account IDs in the
// array.
AccountIdentifiers []string
// If you are using a monitoring account, set this to True to have the operation
// return log groups in the accounts listed in accountIdentifiers . If this
// parameter is set to true and accountIdentifiers contains a null value, the
// operation returns all log groups in the monitoring account and all log groups in
// all source accounts that are linked to the monitoring account.
// If you are using a monitoring account, set this to true to have the operation
// return log groups in the accounts listed in accountIdentifiers .
//
// If this parameter is set to true and accountIdentifiers contains a null value,
// the operation returns all log groups in the monitoring account and all log
// groups in all source accounts that are linked to the monitoring account.
//
// The default for this parameter is false .
IncludeLinkedAccounts *bool
// The maximum number of items returned. If you don't specify a value, the default
// is up to 50 items.
Limit *int32
// Specifies the log group class for this log group. There are two classes:
// Use this parameter to limit the results to only those log groups in the
// specified log group class. If you omit this parameter, log groups of all classes
// can be returned.
//
// Specifies the log group class for this log group. There are three classes:
//
// - The Standard log class supports all CloudWatch Logs features.
//
// - The Infrequent Access log class supports a subset of CloudWatch Logs
// features and incurs lower costs.
// For details about the features supported by each class, see Log classes (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html)
//
// - Use the Delivery log class only for delivering Lambda logs to store in
// Amazon S3 or Amazon Data Firehose. Log events in log groups in the Delivery
// class are kept in CloudWatch Logs for only one day. This log class doesn't offer
// rich CloudWatch Logs capabilities such as CloudWatch Logs Insights queries.
//
// For details about the features supported by each class, see [Log classes]
//
// [Log classes]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html
LogGroupClass types.LogGroupClass
// Use this array to filter the list of log groups returned. If you specify this
// parameter, the only other filter that you can choose to specify is
// includeLinkedAccounts .
//
// If you are using this operation in a monitoring account, you can specify the
// ARNs of log groups in source accounts and in the monitoring account itself. If
// you are using this operation in an account that is not a cross-account
// monitoring account, you can specify only log group names in the same account as
// the operation.
LogGroupIdentifiers []string
// If you specify a string for this parameter, the operation returns only log
// groups that have names that match the string based on a case-sensitive substring
// search. For example, if you specify Foo , log groups named FooBar , aws/Foo ,
// and GroupFoo would match, but foo , F/o/o and Froo would not match. If you
// specify logGroupNamePattern in your request, then only arn , creationTime , and
// logGroupName are included in the response. logGroupNamePattern and
// logGroupNamePrefix are mutually exclusive. Only one of these parameters can be
// passed.
// search. For example, if you specify DataLogs , log groups named DataLogs ,
// aws/DataLogs , and GroupDataLogs would match, but datalogs , Data/log/s and
// Groupdata would not match.
//
// If you specify logGroupNamePattern in your request, then only arn , creationTime
// , and logGroupName are included in the response.
//
// logGroupNamePattern and logGroupNamePrefix are mutually exclusive. Only one of
// these parameters can be passed.
LogGroupNamePattern *string
// The prefix to match. logGroupNamePrefix and logGroupNamePattern are mutually
// exclusive. Only one of these parameters can be passed.
// The prefix to match.
//
// logGroupNamePrefix and logGroupNamePattern are mutually exclusive. Only one of
// these parameters can be passed.
LogGroupNamePrefix *string
// The token for the next set of items to return. (You received this token from a
@@ -86,8 +122,8 @@ type DescribeLogGroupsInput struct {
type DescribeLogGroupsOutput struct {
// The log groups. If the retentionInDays value is not included for a log group,
// then that log group's events do not expire.
// An array of structures, where each structure contains the information about one
// log group.
LogGroups []types.LogGroup
// The token for the next set of items to return. The token expires after 24 hours.
@@ -121,25 +157,28 @@ func (c *Client) addOperationDescribeLogGroupsMiddlewares(stack *middleware.Stac
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -154,10 +193,19 @@ func (c *Client) addOperationDescribeLogGroupsMiddlewares(stack *middleware.Stac
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLogGroups(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -172,17 +220,51 @@ func (c *Client) addOperationDescribeLogGroupsMiddlewares(stack *middleware.Stac
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// DescribeLogGroupsAPIClient is a client that implements the DescribeLogGroups
// operation.
type DescribeLogGroupsAPIClient interface {
DescribeLogGroups(context.Context, *DescribeLogGroupsInput, ...func(*Options)) (*DescribeLogGroupsOutput, error)
}
var _ DescribeLogGroupsAPIClient = (*Client)(nil)
// DescribeLogGroupsPaginatorOptions is the paginator options for DescribeLogGroups
type DescribeLogGroupsPaginatorOptions struct {
// The maximum number of items returned. If you don't specify a value, the default
@@ -247,6 +329,9 @@ func (p *DescribeLogGroupsPaginator) NextPage(ctx context.Context, optFns ...fun
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.DescribeLogGroups(ctx, &params, optFns...)
if err != nil {
return nil, err
@@ -266,6 +351,14 @@ func (p *DescribeLogGroupsPaginator) NextPage(ctx context.Context, optFns ...fun
return result, nil
}
// DescribeLogGroupsAPIClient is a client that implements the DescribeLogGroups
// operation.
type DescribeLogGroupsAPIClient interface {
DescribeLogGroups(context.Context, *DescribeLogGroupsInput, ...func(*Options)) (*DescribeLogGroupsOutput, error)
}
var _ DescribeLogGroupsAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opDescribeLogGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -14,14 +13,20 @@ import (
// Lists the log streams for the specified log group. You can list all the log
// streams or filter the results by prefix. You can also control how the results
// are ordered. You can specify the log group to search by using either
// logGroupIdentifier or logGroupName . You must include one of these two
// parameters, but you can't include both. This operation has a limit of five
// transactions per second, after which transactions are throttled. If you are
// using CloudWatch cross-account observability, you can use this operation in a
// monitoring account and view data from the linked source accounts. For more
// information, see CloudWatch cross-account observability (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html)
// .
// are ordered.
//
// You can specify the log group to search by using either logGroupIdentifier or
// logGroupName . You must include one of these two parameters, but you can't
// include both.
//
// This operation has a limit of 25 transactions per second, after which
// transactions are throttled.
//
// If you are using CloudWatch cross-account observability, you can use this
// operation in a monitoring account and view data from the linked source accounts.
// For more information, see [CloudWatch cross-account observability].
//
// [CloudWatch cross-account observability]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html
func (c *Client) DescribeLogStreams(ctx context.Context, params *DescribeLogStreamsInput, optFns ...func(*Options)) (*DescribeLogStreamsOutput, error) {
if params == nil {
params = &DescribeLogStreamsInput{}
@@ -49,16 +54,19 @@ type DescribeLogStreamsInput struct {
// Specify either the name or ARN of the log group to view. If the log group is in
// a source account and you are using a monitoring account, you must use the log
// group ARN. You must include either logGroupIdentifier or logGroupName , but not
// both.
// group ARN.
//
// You must include either logGroupIdentifier or logGroupName , but not both.
LogGroupIdentifier *string
// The name of the log group. You must include either logGroupIdentifier or
// logGroupName , but not both.
// The name of the log group.
//
// You must include either logGroupIdentifier or logGroupName , but not both.
LogGroupName *string
// The prefix to match. If orderBy is LastEventTime , you cannot specify this
// parameter.
// The prefix to match.
//
// If orderBy is LastEventTime , you cannot specify this parameter.
LogStreamNamePrefix *string
// The token for the next set of items to return. (You received this token from a
@@ -67,13 +75,16 @@ type DescribeLogStreamsInput struct {
// If the value is LogStreamName , the results are ordered by log stream name. If
// the value is LastEventTime , the results are ordered by the event time. The
// default value is LogStreamName . If you order the results by event time, you
// cannot specify the logStreamNamePrefix parameter. lastEventTimestamp represents
// the time of the most recent log event in the log stream in CloudWatch Logs. This
// number is expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC
// . lastEventTimestamp updates on an eventual consistency basis. It typically
// updates in less than an hour from ingestion, but in rare situations might take
// longer.
// default value is LogStreamName .
//
// If you order the results by event time, you cannot specify the
// logStreamNamePrefix parameter.
//
// lastEventTimestamp represents the time of the most recent log event in the log
// stream in CloudWatch Logs. This number is expressed as the number of
// milliseconds after Jan 1, 1970 00:00:00 UTC . lastEventTimestamp updates on an
// eventual consistency basis. It typically updates in less than an hour from
// ingestion, but in rare situations might take longer.
OrderBy types.OrderBy
noSmithyDocumentSerde
@@ -115,25 +126,28 @@ func (c *Client) addOperationDescribeLogStreamsMiddlewares(stack *middleware.Sta
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -148,10 +162,19 @@ func (c *Client) addOperationDescribeLogStreamsMiddlewares(stack *middleware.Sta
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLogStreams(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -166,17 +189,51 @@ func (c *Client) addOperationDescribeLogStreamsMiddlewares(stack *middleware.Sta
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// DescribeLogStreamsAPIClient is a client that implements the DescribeLogStreams
// operation.
type DescribeLogStreamsAPIClient interface {
DescribeLogStreams(context.Context, *DescribeLogStreamsInput, ...func(*Options)) (*DescribeLogStreamsOutput, error)
}
var _ DescribeLogStreamsAPIClient = (*Client)(nil)
// DescribeLogStreamsPaginatorOptions is the paginator options for
// DescribeLogStreams
type DescribeLogStreamsPaginatorOptions struct {
@@ -242,6 +299,9 @@ func (p *DescribeLogStreamsPaginator) NextPage(ctx context.Context, optFns ...fu
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.DescribeLogStreams(ctx, &params, optFns...)
if err != nil {
return nil, err
@@ -261,6 +321,14 @@ func (p *DescribeLogStreamsPaginator) NextPage(ctx context.Context, optFns ...fu
return result, nil
}
// DescribeLogStreamsAPIClient is a client that implements the DescribeLogStreams
// operation.
type DescribeLogStreamsAPIClient interface {
DescribeLogStreams(context.Context, *DescribeLogStreamsInput, ...func(*Options)) (*DescribeLogStreamsOutput, error)
}
var _ DescribeLogStreamsAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opDescribeLogStreams(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -96,25 +95,28 @@ func (c *Client) addOperationDescribeMetricFiltersMiddlewares(stack *middleware.
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -129,10 +131,19 @@ func (c *Client) addOperationDescribeMetricFiltersMiddlewares(stack *middleware.
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMetricFilters(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -147,17 +158,51 @@ func (c *Client) addOperationDescribeMetricFiltersMiddlewares(stack *middleware.
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// DescribeMetricFiltersAPIClient is a client that implements the
// DescribeMetricFilters operation.
type DescribeMetricFiltersAPIClient interface {
DescribeMetricFilters(context.Context, *DescribeMetricFiltersInput, ...func(*Options)) (*DescribeMetricFiltersOutput, error)
}
var _ DescribeMetricFiltersAPIClient = (*Client)(nil)
// DescribeMetricFiltersPaginatorOptions is the paginator options for
// DescribeMetricFilters
type DescribeMetricFiltersPaginatorOptions struct {
@@ -223,6 +268,9 @@ func (p *DescribeMetricFiltersPaginator) NextPage(ctx context.Context, optFns ..
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.DescribeMetricFilters(ctx, &params, optFns...)
if err != nil {
return nil, err
@@ -242,6 +290,14 @@ func (p *DescribeMetricFiltersPaginator) NextPage(ctx context.Context, optFns ..
return result, nil
}
// DescribeMetricFiltersAPIClient is a client that implements the
// DescribeMetricFilters operation.
type DescribeMetricFiltersAPIClient interface {
DescribeMetricFilters(context.Context, *DescribeMetricFiltersInput, ...func(*Options)) (*DescribeMetricFiltersOutput, error)
}
var _ DescribeMetricFiltersAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opDescribeMetricFilters(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -41,6 +40,10 @@ type DescribeQueriesInput struct {
// The token for the next set of items to return. The token expires after 24 hours.
NextToken *string
// Limits the returned queries to only the queries that use the specified query
// language.
QueryLanguage types.QueryLanguage
// Limits the returned queries to only those that have the specified status. Valid
// values are Cancelled , Complete , Failed , Running , and Scheduled .
Status types.QueryStatus
@@ -84,25 +87,28 @@ func (c *Client) addOperationDescribeQueriesMiddlewares(stack *middleware.Stack,
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -117,10 +123,19 @@ func (c *Client) addOperationDescribeQueriesMiddlewares(stack *middleware.Stack,
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeQueries(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -135,6 +150,48 @@ func (c *Client) addOperationDescribeQueriesMiddlewares(stack *middleware.Stack,
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -14,9 +13,10 @@ import (
// This operation returns a paginated list of your saved CloudWatch Logs Insights
// query definitions. You can retrieve query definitions from the current account
// or from a source account that is linked to the current account. You can use the
// queryDefinitionNamePrefix parameter to limit the results to only the query
// definitions that have names that start with a certain string.
// or from a source account that is linked to the current account.
//
// You can use the queryDefinitionNamePrefix parameter to limit the results to
// only the query definitions that have names that start with a certain string.
func (c *Client) DescribeQueryDefinitions(ctx context.Context, params *DescribeQueryDefinitionsInput, optFns ...func(*Options)) (*DescribeQueryDefinitionsOutput, error) {
if params == nil {
params = &DescribeQueryDefinitionsInput{}
@@ -44,6 +44,12 @@ type DescribeQueryDefinitionsInput struct {
// have names that start with the prefix you specify.
QueryDefinitionNamePrefix *string
// The query language used for this query. For more information about the query
// languages that CloudWatch Logs supports, see [Supported query languages].
//
// [Supported query languages]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html
QueryLanguage types.QueryLanguage
noSmithyDocumentSerde
}
@@ -83,25 +89,28 @@ func (c *Client) addOperationDescribeQueryDefinitionsMiddlewares(stack *middlewa
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -116,10 +125,19 @@ func (c *Client) addOperationDescribeQueryDefinitionsMiddlewares(stack *middlewa
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeQueryDefinitions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -134,6 +152,48 @@ func (c *Client) addOperationDescribeQueryDefinitionsMiddlewares(stack *middlewa
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -37,6 +36,13 @@ type DescribeResourcePoliciesInput struct {
// The token for the next set of items to return. The token expires after 24 hours.
NextToken *string
// Specifies the scope of the resource policy. Valid values are ACCOUNT or RESOURCE
// . When not specified, defaults to ACCOUNT .
PolicyScope types.PolicyScope
// The ARN of the CloudWatch Logs resource for which to query the resource policy.
ResourceArn *string
noSmithyDocumentSerde
}
@@ -76,25 +82,28 @@ func (c *Client) addOperationDescribeResourcePoliciesMiddlewares(stack *middlewa
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -109,10 +118,19 @@ func (c *Client) addOperationDescribeResourcePoliciesMiddlewares(stack *middlewa
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeResourcePolicies(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -127,6 +145,48 @@ func (c *Client) addOperationDescribeResourcePoliciesMiddlewares(stack *middlewa
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,7 +6,6 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
@@ -87,25 +86,28 @@ func (c *Client) addOperationDescribeSubscriptionFiltersMiddlewares(stack *middl
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -120,13 +122,22 @@ func (c *Client) addOperationDescribeSubscriptionFiltersMiddlewares(stack *middl
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDescribeSubscriptionFiltersValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSubscriptionFilters(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -141,17 +152,51 @@ func (c *Client) addOperationDescribeSubscriptionFiltersMiddlewares(stack *middl
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// DescribeSubscriptionFiltersAPIClient is a client that implements the
// DescribeSubscriptionFilters operation.
type DescribeSubscriptionFiltersAPIClient interface {
DescribeSubscriptionFilters(context.Context, *DescribeSubscriptionFiltersInput, ...func(*Options)) (*DescribeSubscriptionFiltersOutput, error)
}
var _ DescribeSubscriptionFiltersAPIClient = (*Client)(nil)
// DescribeSubscriptionFiltersPaginatorOptions is the paginator options for
// DescribeSubscriptionFilters
type DescribeSubscriptionFiltersPaginatorOptions struct {
@@ -219,6 +264,9 @@ func (p *DescribeSubscriptionFiltersPaginator) NextPage(ctx context.Context, opt
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.DescribeSubscriptionFilters(ctx, &params, optFns...)
if err != nil {
return nil, err
@@ -238,6 +286,14 @@ func (p *DescribeSubscriptionFiltersPaginator) NextPage(ctx context.Context, opt
return result, nil
}
// DescribeSubscriptionFiltersAPIClient is a client that implements the
// DescribeSubscriptionFilters operation.
type DescribeSubscriptionFiltersAPIClient interface {
DescribeSubscriptionFilters(context.Context, *DescribeSubscriptionFiltersInput, ...func(*Options)) (*DescribeSubscriptionFiltersOutput, error)
}
var _ DescribeSubscriptionFiltersAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opDescribeSubscriptionFilters(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,

View File

@@ -6,31 +6,34 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disassociates the specified KMS key from the specified log group or from all
// CloudWatch Logs Insights query results in the account. When you use
// DisassociateKmsKey , you specify either the logGroupName parameter or the
// resourceIdentifier parameter. You can't specify both of those parameters in the
// same operation.
// CloudWatch Logs Insights query results in the account.
//
// When you use DisassociateKmsKey , you specify either the logGroupName parameter
// or the resourceIdentifier parameter. You can't specify both of those parameters
// in the same operation.
//
// - Specify the logGroupName parameter to stop using the KMS key to encrypt
// future log events ingested and stored in the log group. Instead, they will be
// encrypted with the default CloudWatch Logs method. The log events that were
// ingested while the key was associated with the log group are still encrypted
// with that key. Therefore, CloudWatch Logs will need permissions for the key
// whenever that data is accessed.
//
// - Specify the resourceIdentifier parameter with the query-result resource to
// stop using the KMS key to encrypt the results of all future StartQuery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html)
// operations in the account. They will instead be encrypted with the default
// CloudWatch Logs method. The results from queries that ran while the key was
// associated with the account are still encrypted with that key. Therefore,
// CloudWatch Logs will need permissions for the key whenever that data is
// accessed.
// stop using the KMS key to encrypt the results of all future [StartQuery]operations in the
// account. They will instead be encrypted with the default CloudWatch Logs method.
// The results from queries that ran while the key was associated with the account
// are still encrypted with that key. Therefore, CloudWatch Logs will need
// permissions for the key whenever that data is accessed.
//
// It can take up to 5 minutes for this operation to take effect.
//
// [StartQuery]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html
func (c *Client) DisassociateKmsKey(ctx context.Context, params *DisassociateKmsKeyInput, optFns ...func(*Options)) (*DisassociateKmsKeyOutput, error) {
if params == nil {
params = &DisassociateKmsKeyInput{}
@@ -48,25 +51,34 @@ func (c *Client) DisassociateKmsKey(ctx context.Context, params *DisassociateKms
type DisassociateKmsKeyInput struct {
// The name of the log group. In your DisassociateKmsKey operation, you must
// specify either the resourceIdentifier parameter or the logGroup parameter, but
// you can't specify both.
// The name of the log group.
//
// In your DisassociateKmsKey operation, you must specify either the
// resourceIdentifier parameter or the logGroup parameter, but you can't specify
// both.
LogGroupName *string
// Specifies the target for this operation. You must specify one of the following:
//
// - Specify the ARN of a log group to stop having CloudWatch Logs use the KMS
// key to encrypt log events that are ingested and stored by that log group. After
// you run this operation, CloudWatch Logs encrypts ingested log events with the
// default CloudWatch Logs method. The log group ARN must be in the following
// format. Replace REGION and ACCOUNT_ID with your Region and account ID.
// arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
//
// arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME
//
// - Specify the following ARN to stop using this key to encrypt the results of
// future StartQuery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html)
// operations in this account. Replace REGION and ACCOUNT_ID with your Region and
// account ID. arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
// future [StartQuery]operations in this account. Replace REGION and ACCOUNT_ID with your
// Region and account ID.
//
// arn:aws:logs:REGION:ACCOUNT_ID:query-result:*
//
// In your DisssociateKmsKey operation, you must specify either the
// resourceIdentifier parameter or the logGroup parameter, but you can't specify
// both.
//
// [StartQuery]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html
ResourceIdentifier *string
noSmithyDocumentSerde
@@ -101,25 +113,28 @@ func (c *Client) addOperationDisassociateKmsKeyMiddlewares(stack *middleware.Sta
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -134,10 +149,19 @@ func (c *Client) addOperationDisassociateKmsKeyMiddlewares(stack *middleware.Sta
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateKmsKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -152,6 +176,48 @@ func (c *Client) addOperationDisassociateKmsKeyMiddlewares(stack *middleware.Sta
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}

View File

@@ -6,29 +6,57 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists log events from the specified log group. You can list all the log events
// or filter the results using a filter pattern, a time range, and the name of the
// log stream. You must have the logs:FilterLogEvents permission to perform this
// operation. You can specify the log group to search by using either
// logGroupIdentifier or logGroupName . You must include one of these two
// parameters, but you can't include both. By default, this operation returns as
// many log events as can fit in 1 MB (up to 10,000 log events) or all the events
// found within the specified time range. If the results include a token, that
// means there are more log events available. You can get additional results by
// specifying the token in a subsequent call. This operation can return empty
// results while there are more log events available through the token. The
// returned log events are sorted by event timestamp, the timestamp when the event
// was ingested by CloudWatch Logs, and the ID of the PutLogEvents request. If you
// are using CloudWatch cross-account observability, you can use this operation in
// a monitoring account and view data from the linked source accounts. For more
// information, see CloudWatch cross-account observability (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html)
// .
// or filter the results using one or more of the following:
//
// - A filter pattern
//
// - A time range
//
// - The log stream name, or a log stream name prefix that matches multiple log
// streams
//
// You must have the logs:FilterLogEvents permission to perform this operation.
//
// You can specify the log group to search by using either logGroupIdentifier or
// logGroupName . You must include one of these two parameters, but you can't
// include both.
//
// FilterLogEvents is a paginated operation. Each page returned can contain up to
// 1 MB of log events or up to 10,000 log events. A returned page might only be
// partially full, or even empty. For example, if the result of a query would
// return 15,000 log events, the first page isn't guaranteed to have 10,000 log
// events even if they all fit into 1 MB.
//
// Partially full or empty pages don't necessarily mean that pagination is
// finished. If the results include a nextToken , there might be more log events
// available. You can return these additional log events by providing the nextToken
// in a subsequent FilterLogEvents operation. If the results don't include a
// nextToken , then pagination is finished.
//
// Specifying the limit parameter only guarantees that a single page doesn't
// return more log events than the specified limit, but it might return fewer
// events than the limit. This is the expected API behavior.
//
// The returned log events are sorted by event timestamp, the timestamp when the
// event was ingested by CloudWatch Logs, and the ID of the PutLogEvents request.
//
// If you are using CloudWatch cross-account observability, you can use this
// operation in a monitoring account and view data from the linked source accounts.
// For more information, see [CloudWatch cross-account observability].
//
// If you are using [log transformation], the FilterLogEvents operation returns only the original
// versions of log events, before they were transformed. To view the transformed
// versions, you must use a [CloudWatch Logs query.]
//
// [log transformation]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html
// [CloudWatch cross-account observability]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html
// [CloudWatch Logs query.]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html
func (c *Client) FilterLogEvents(ctx context.Context, params *FilterLogEventsInput, optFns ...func(*Options)) (*FilterLogEventsOutput, error) {
if params == nil {
params = &FilterLogEventsInput{}
@@ -51,14 +79,18 @@ type FilterLogEventsInput struct {
// returned.
EndTime *int64
// The filter pattern to use. For more information, see Filter and Pattern Syntax (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html)
// . If not provided, all the events are matched.
// The filter pattern to use. For more information, see [Filter and Pattern Syntax].
//
// If not provided, all the events are matched.
//
// [Filter and Pattern Syntax]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html
FilterPattern *string
// If the value is true, the operation attempts to provide responses that contain
// events from multiple log streams within the log group, interleaved in a single
// response. If the value is false, all the matched log events in the first log
// stream are searched first, then those in the next log stream, and so on.
//
// Important As of June 17, 2019, this parameter is ignored and the value is
// assumed to be true. The response from this operation always interleaves events
// from multiple log streams within a log group.
@@ -73,24 +105,27 @@ type FilterLogEventsInput struct {
// Specify either the name or ARN of the log group to view log events from. If the
// log group is in a source account and you are using a monitoring account, you
// must use the log group ARN. You must include either logGroupIdentifier or
// logGroupName , but not both.
// must use the log group ARN.
//
// You must include either logGroupIdentifier or logGroupName , but not both.
LogGroupIdentifier *string
// The name of the log group to search. You must include either logGroupIdentifier
// or logGroupName , but not both.
// The name of the log group to search.
//
// You must include either logGroupIdentifier or logGroupName , but not both.
LogGroupName *string
// Filters the results to include only events from log streams that have names
// starting with this prefix. If you specify a value for both logStreamNamePrefix
// and logStreamNames , but the value for logStreamNamePrefix does not match any
// log stream names specified in logStreamNames , the action returns an
// InvalidParameterException error.
// starting with this prefix.
//
// If you specify a value for both logStreamNamePrefix and logStreamNames , the
// action returns an InvalidParameterException error.
LogStreamNamePrefix *string
// Filters the results to only logs from the log streams in this list. If you
// specify a value for both logStreamNamePrefix and logStreamNames , the action
// returns an InvalidParameterException error.
// Filters the results to only logs from the log streams in this list.
//
// If you specify a value for both logStreamNames and logStreamNamePrefix , the
// action returns an InvalidParameterException error.
LogStreamNames []string
// The token for the next set of events to return. (You received this token from a
@@ -102,8 +137,10 @@ type FilterLogEventsInput struct {
StartTime *int64
// Specify true to display the log event fields with all sensitive data unmasked
// and visible. The default is false . To use this operation with this parameter,
// you must be signed into an account with the logs:Unmask permission.
// and visible. The default is false .
//
// To use this operation with this parameter, you must be signed into an account
// with the logs:Unmask permission.
Unmask bool
noSmithyDocumentSerde
@@ -116,11 +153,15 @@ type FilterLogEventsOutput struct {
// The token to use when requesting the next set of items. The token expires after
// 24 hours.
//
// If the results don't include a nextToken , then pagination is finished.
NextToken *string
// Important As of May 15, 2020, this parameter is no longer supported. This
// parameter returns an empty list. Indicates which log streams have been searched
// and whether each has been searched completely.
// Important As of May 15, 2020, this parameter is no longer supported. This
// parameter returns an empty list.
//
// Indicates which log streams have been searched and whether each has been
// searched completely.
SearchedLogStreams []types.SearchedLogStream
// Metadata pertaining to the operation's result.
@@ -151,25 +192,28 @@ func (c *Client) addOperationFilterLogEventsMiddlewares(stack *middleware.Stack,
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
if err = addClientRequestID(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
if err = addRetry(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addSpanRetryLoop(stack, options); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
@@ -184,10 +228,19 @@ func (c *Client) addOperationFilterLogEventsMiddlewares(stack *middleware.Stack,
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opFilterLogEvents(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
@@ -202,17 +255,51 @@ func (c *Client) addOperationFilterLogEventsMiddlewares(stack *middleware.Stack,
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
return err
}
if err = addInterceptAttempt(stack, options); err != nil {
return err
}
if err = addInterceptExecution(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSerialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterSerialization(stack, options); err != nil {
return err
}
if err = addInterceptBeforeSigning(stack, options); err != nil {
return err
}
if err = addInterceptAfterSigning(stack, options); err != nil {
return err
}
if err = addInterceptTransmit(stack, options); err != nil {
return err
}
if err = addInterceptBeforeDeserialization(stack, options); err != nil {
return err
}
if err = addInterceptAfterDeserialization(stack, options); err != nil {
return err
}
if err = addSpanInitializeStart(stack); err != nil {
return err
}
if err = addSpanInitializeEnd(stack); err != nil {
return err
}
if err = addSpanBuildRequestStart(stack); err != nil {
return err
}
if err = addSpanBuildRequestEnd(stack); err != nil {
return err
}
return nil
}
// FilterLogEventsAPIClient is a client that implements the FilterLogEvents
// operation.
type FilterLogEventsAPIClient interface {
FilterLogEvents(context.Context, *FilterLogEventsInput, ...func(*Options)) (*FilterLogEventsOutput, error)
}
var _ FilterLogEventsAPIClient = (*Client)(nil)
// FilterLogEventsPaginatorOptions is the paginator options for FilterLogEvents
type FilterLogEventsPaginatorOptions struct {
// The maximum number of events to return. The default is 10,000 events.
@@ -276,6 +363,9 @@ func (p *FilterLogEventsPaginator) NextPage(ctx context.Context, optFns ...func(
}
params.Limit = limit
optFns = append([]func(*Options){
addIsPaginatorUserAgent,
}, optFns...)
result, err := p.client.FilterLogEvents(ctx, &params, optFns...)
if err != nil {
return nil, err
@@ -295,6 +385,14 @@ func (p *FilterLogEventsPaginator) NextPage(ctx context.Context, optFns ...func(
return result, nil
}
// FilterLogEventsAPIClient is a client that implements the FilterLogEvents
// operation.
type FilterLogEventsAPIClient interface {
FilterLogEvents(context.Context, *FilterLogEventsInput, ...func(*Options)) (*FilterLogEventsOutput, error)
}
var _ FilterLogEventsAPIClient = (*Client)(nil)
func newServiceMetadataMiddleware_opFilterLogEvents(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,

Some files were not shown because too many files have changed in this diff Show More