diff --git a/Makefile b/Makefile index c7c18dd9b..79e2b3ce2 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,8 @@ VERSION ?= 1.0.0-dev CONTAINER_MANAGER ?= podman # Image URL to use all building/pushing image targets -IMG ?= quay.io/redhat-developer/mapt:v${VERSION} -TKN_IMG ?= quay.io/redhat-developer/mapt:v${VERSION}-tkn +IMG ?= ghcr.io/redhat-developer/mapt:pr-421 +TKN_IMG ?= ghcr.io/redhat-developer/mapt:pr-421-tkn # Integrations # renovate: datasource=github-releases depName=cirruslabs/cirrus-cli diff --git a/cmd/mapt/cmd/aws/services/mac-pool.go b/cmd/mapt/cmd/aws/services/mac-pool.go index b0332b107..d7ecb0a02 100644 --- a/cmd/mapt/cmd/aws/services/mac-pool.go +++ b/cmd/mapt/cmd/aws/services/mac-pool.go @@ -20,6 +20,7 @@ const ( cmdHousekeep = "house-keep" cmdHousekeepDesc = "house keeping for mac pool. Detroy old machines on over capacity and create new ones if capacity not meet" + // Pool params paramName = "name" paramNameDesc = "pool name it is a unique identifier for the pool. The name should be unique for the whole AWS account" paramOfferedCapacity = "offered-capacity" @@ -28,6 +29,17 @@ const ( paramMaxSize = "max-size" paramMaxSizeDesc = "max number of machines in the pool" paramMaxSizeDefault = 2 + // Machines in the pool params + paramVPCID = "vpcid" + paramVPCIDDesc = "VPC Id to setup mac machines" + paramVPCIDDefault = "" + paramSSHSGID = "ssh-sgid" + paramSSHSGIDDesc = "Security group Id to securize ssh access to machines. SSH can only be used from instances with this SG." + paramSSHSGIDDefault = "" + // Request / Release + paramTicket = "ticket" + paramTicketDesc = "this is a unique identifier to tag the dedicated host meanwhile it is being locked to identify the request which locked it. It will be used on release to identify the machine being released" + paramTicketDefault = "" ) func GetMacPoolCmd() *cobra.Command { @@ -67,14 +79,13 @@ func createMP() *cobra.Command { DebugLevel: viper.GetUint(params.DebugLevel), Tags: viper.GetStringMapString(params.Tags), }, - &macpool.MacPoolRequestArgs{ + &macpool.PoolRequestArgs{ Prefix: "main", - PoolName: viper.GetString(paramName), + Name: viper.GetString(paramName), Architecture: viper.GetString(awsParams.MACArch), OSVersion: viper.GetString(awsParams.MACOSVersion), OfferedCapacity: viper.GetInt(paramOfferedCapacity), - MaxSize: viper.GetInt(paramMaxSize), - FixedLocation: viper.IsSet(awsParams.MACFixedLocation)}); err != nil { + MaxSize: viper.GetInt(paramMaxSize)}); err != nil { logging.Error(err) } return nil @@ -89,7 +100,6 @@ func createMP() *cobra.Command { flagSet.StringP(awsParams.MACArch, "", awsParams.MACArchDefault, awsParams.MACArchDesc) flagSet.StringP(awsParams.MACOSVersion, "", awsParams.MACOSVersionDefault, awsParams.MACOSVersionDesc) flagSet.StringToStringP(params.Tags, "", nil, params.TagsDesc) - flagSet.Bool(awsParams.MACFixedLocation, false, awsParams.MACFixedLocationDesc) c.PersistentFlags().AddFlagSet(flagSet) return c } @@ -138,28 +148,35 @@ func houseKeep() *cobra.Command { DebugLevel: viper.GetUint(params.DebugLevel), Tags: viper.GetStringMapString(params.Tags), }, - &macpool.MacPoolRequestArgs{ - Prefix: "main", - PoolName: viper.GetString(paramName), - Architecture: viper.GetString(awsParams.MACArch), - OSVersion: viper.GetString(awsParams.MACOSVersion), - OfferedCapacity: viper.GetInt(paramOfferedCapacity), - MaxSize: viper.GetInt(paramMaxSize), - FixedLocation: viper.IsSet(awsParams.MACFixedLocation)}); err != nil { + &macpool.HouseKeepRequestArgs{ + Pool: &macpool.PoolRequestArgs{ + Prefix: "main", + Name: viper.GetString(paramName), + Architecture: viper.GetString(awsParams.MACArch), + OSVersion: viper.GetString(awsParams.MACOSVersion), + OfferedCapacity: viper.GetInt(paramOfferedCapacity), + MaxSize: viper.GetInt(paramMaxSize), + }, + Machine: &macpool.MachineRequestArgs{ + VPCID: viper.GetString(paramVPCID), + SSHSGID: viper.GetString(paramSSHSGID)}, + }); err != nil { logging.Error(err) } return nil }, } flagSet := pflag.NewFlagSet(params.CreateCmdName, pflag.ExitOnError) + params.AddCommonFlags(flagSet) flagSet.StringToStringP(params.Tags, "", nil, params.TagsDesc) flagSet.StringP(paramName, "", "", paramNameDesc) flagSet.Int(paramOfferedCapacity, paramOfferedCapacityDefault, paramOfferedCapacityDesc) flagSet.Int(paramMaxSize, paramMaxSizeDefault, paramMaxSizeDesc) flagSet.StringP(awsParams.MACArch, "", awsParams.MACArchDefault, awsParams.MACArchDesc) flagSet.StringP(awsParams.MACOSVersion, "", awsParams.MACOSVersion, awsParams.MACOSVersionDefault) - flagSet.Bool(awsParams.MACFixedLocation, false, awsParams.MACFixedLocationDesc) flagSet.Bool(params.Serverless, false, params.ServerlessDesc) + flagSet.StringP(paramVPCID, "", paramVPCIDDefault, paramVPCIDDesc) + flagSet.StringP(paramSSHSGID, "", paramSSHSGIDDefault, paramSSHSGIDDesc) c.PersistentFlags().AddFlagSet(flagSet) return c } @@ -177,6 +194,8 @@ func request() *cobra.Command { ResultsOutput: viper.GetString(params.ConnectionDetailsOutput), Debug: viper.IsSet(params.Debug), DebugLevel: viper.GetUint(params.DebugLevel), + Serverless: viper.IsSet(params.Serverless), + Remote: viper.IsSet(params.Remote), Tags: viper.GetStringMapString(params.Tags), } @@ -207,7 +226,12 @@ func request() *cobra.Command { PoolName: viper.GetString(paramName), Architecture: viper.GetString(awsParams.MACArch), OSVersion: viper.GetString(awsParams.MACOSVersion), - Timeout: viper.GetString(params.Timeout), + Machine: &macpool.MachineRequestArgs{ + VPCID: viper.GetString(paramVPCID), + SSHSGID: viper.GetString(paramSSHSGID), + }, + Ticket: viper.GetString(paramTicket), + Timeout: viper.GetString(params.Timeout), }); err != nil { logging.Error(err) } @@ -221,6 +245,11 @@ func request() *cobra.Command { flagSet.StringP(awsParams.MACArch, "", awsParams.MACArchDefault, awsParams.MACArchDesc) flagSet.StringP(awsParams.MACOSVersion, "", awsParams.MACOSVersion, awsParams.MACOSVersionDefault) flagSet.StringP(params.Timeout, "", "", params.TimeoutDesc) + flagSet.StringP(paramVPCID, "", paramVPCIDDefault, paramVPCIDDesc) + flagSet.StringP(paramSSHSGID, "", paramSSHSGIDDefault, paramSSHSGIDDesc) + flagSet.StringP(paramTicket, "", paramTicketDefault, paramTicketDesc) + flagSet.Bool(params.Serverless, false, params.ServerlessDesc) + flagSet.Bool(params.Remote, false, params.RemoteDesc) flagSet.AddFlagSet(params.GetGHActionsFlagset()) params.AddCirrusFlags(flagSet) c.PersistentFlags().AddFlagSet(flagSet) @@ -241,20 +270,24 @@ func release() *cobra.Command { Debug: viper.IsSet(params.Debug), DebugLevel: viper.GetUint(params.DebugLevel), Serverless: viper.IsSet(params.Serverless), + Remote: viper.IsSet(params.Remote), }, - viper.GetString(awsParams.MACDHID)); err != nil { + &macpool.MachineRequestArgs{ + VPCID: viper.GetString(paramVPCID), + SSHSGID: viper.GetString(paramSSHSGID), + }, + viper.GetString(paramTicket)); err != nil { logging.Error(err) } return nil }, } flagSet := pflag.NewFlagSet(awsParams.MACReleaseCmd, pflag.ExitOnError) - flagSet.StringP(awsParams.MACDHID, "", "", awsParams.MACDHIDDesc) + flagSet.StringP(paramVPCID, "", paramVPCIDDefault, paramVPCIDDesc) + flagSet.StringP(paramSSHSGID, "", paramSSHSGIDDefault, paramSSHSGIDDesc) + flagSet.StringP(paramTicket, "", paramTicketDefault, paramTicketDesc) flagSet.Bool(params.Serverless, false, params.ServerlessDesc) + flagSet.Bool(params.Remote, false, params.RemoteDesc) c.PersistentFlags().AddFlagSet(flagSet) - err := c.MarkPersistentFlagRequired(awsParams.MACDHID) - if err != nil { - logging.Error(err) - } return c } diff --git a/cmd/mapt/cmd/constants/constants.go b/cmd/mapt/cmd/constants/constants.go index 8981dd92e..e4f2824dd 100644 --- a/cmd/mapt/cmd/constants/constants.go +++ b/cmd/mapt/cmd/constants/constants.go @@ -77,10 +77,13 @@ const ( RhelVersionDefault string = "9.4" // Serverless - Timeout string = "timeout" - TimeoutDesc string = "if timeout is set a serverless destroy actions will be set on the time according to the timeout. The Timeout value is a duration conforming to Go ParseDuration format." + Timeout string = "timeout" + TimeoutDesc string = "if timeout is set a serverless destroy actions will be set on the time according to the timeout. The Timeout value is a duration conforming to Go ParseDuration format." + // TODO we should be able to know if it is being executed serverless just checking the ENVs?? Serverless string = "serverless" ServerlessDesc string = "if serverless is set the command will be executed as a serverless action." + Remote string = "remote" + RemoteDesc string = "run the action remote through a servlerss execution." // Desytoy ForceDestroy string = "force-destroy" diff --git a/go.mod b/go.mod index d40e67698..d2875e00b 100644 --- a/go.mod +++ b/go.mod @@ -21,6 +21,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.36.3 github.com/aws/aws-sdk-go-v2/config v1.29.14 github.com/aws/aws-sdk-go-v2/service/ec2 v1.222.0 + github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.26.3 github.com/aws/aws-sdk-go-v2/service/s3 v1.79.3 github.com/pulumi/pulumi-aws-native/sdk v1.28.0 github.com/pulumi/pulumi-aws/sdk/v6 v6.81.0 diff --git a/go.sum b/go.sum index bf581755c..c0b5f64c3 100644 --- a/go.sum +++ b/go.sum @@ -75,6 +75,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.15 h1:moLQUoVq91Liq github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.15/go.mod h1:ZH34PJUc8ApjBIfgQCFvkWcUDBtl/WTD+uiYHjd8igA= github.com/aws/aws-sdk-go-v2/service/pricing v1.34.3 h1:vAv0hi3SWcc8cotkWRP4mPkmRbp/XqWKFyPW4Nwpzv0= github.com/aws/aws-sdk-go-v2/service/pricing v1.34.3/go.mod h1:giTP9ufzBQJRB6bc7P30PO8s35hCp6au5uM70zkohU4= +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.26.3 h1:P87jejqS8WvQvRWyXlHUylt99VXt0y/WUIFuU6gBU7A= +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.26.3/go.mod h1:cgPfPTC/V3JqwCKed7Q6d0FrgarV7ltz4Bz6S4Q+Dqk= github.com/aws/aws-sdk-go-v2/service/s3 v1.79.3 h1:BRXS0U76Z8wfF+bnkilA2QwpIch6URlm++yPUt9QPmQ= github.com/aws/aws-sdk-go-v2/service/s3 v1.79.3/go.mod h1:bNXKFFyaiVvWuR6O16h/I1724+aXe/tAkA9/QS01t5k= github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 h1:1Gw+9ajCV1jogloEv1RRnvfRFia2cL6c9cuKV2Ps+G8= diff --git a/pkg/integrations/cirrus/persistentworker.go b/pkg/integrations/cirrus/persistentworker.go index 42b3d458b..a671db738 100644 --- a/pkg/integrations/cirrus/persistentworker.go +++ b/pkg/integrations/cirrus/persistentworker.go @@ -43,7 +43,7 @@ func (args *PersistentWorkerArgs) GetUserDataValues() *integrations.UserDataValu CliURL: downloadURL(), Name: pwa.Name, Token: pwa.Token, - Labels: getLabelsAsString(), + Labels: GetLabelsAsString(), Port: cirrusPort, } } @@ -74,18 +74,8 @@ func GetToken() string { "") } -// platform: darwin, linux, windows -// arch: amd64, arm64 -func downloadURL() string { - url := fmt.Sprintf(baseURL, version, *pwa.Platform, *pwa.Arch) - if pwa.Platform == &Windows { - url = fmt.Sprintf("%s.exe", url) - } - return url -} - // Get labels in format -func getLabelsAsString() string { +func GetLabelsAsString() string { return util.IfNillable(pwa != nil, func() string { if len(pwa.Labels) > 0 { @@ -101,3 +91,13 @@ func getLabelsAsString() string { }, "") } + +// platform: darwin, linux, windows +// arch: amd64, arm64 +func downloadURL() string { + url := fmt.Sprintf(baseURL, version, *pwa.Platform, *pwa.Arch) + if pwa.Platform == &Windows { + url = fmt.Sprintf("%s.exe", url) + } + return url +} diff --git a/pkg/manager/context/context.go b/pkg/manager/context/context.go index f4f63b745..7ee170686 100644 --- a/pkg/manager/context/context.go +++ b/pkg/manager/context/context.go @@ -41,6 +41,8 @@ type ContextArgs struct { Serverless bool // This forces destroy even when lock exists ForceDestroy bool + // If remote is set we will run the action through the serverless task spec + Remote bool // integrations GHRunnerArgs *github.GithubRunnerArgs CirrusPWArgs *cirrus.PersistentWorkerArgs @@ -58,8 +60,11 @@ type context struct { serverless bool forceDestroy bool spotPriceIncreaseRate int + remote bool tags map[string]string tagsAsPulumiStringMap pulumi.StringMap + // This will be set if we need specific customization on a specfici execution + provider Provider } // mapt context @@ -67,6 +72,7 @@ var mc *context type Provider interface { Init(backedURL string) error + Custom(ctx *pulumi.Context) (*pulumi.ProviderResource, error) } func Init(ca *ContextArgs, provider Provider) error { @@ -81,6 +87,8 @@ func Init(ca *ContextArgs, provider Provider) error { serverless: ca.Serverless, forceDestroy: ca.ForceDestroy, spotPriceIncreaseRate: ca.SpotPriceIncreaseRate, + remote: ca.Remote, + provider: provider, } addCommonTags() // Init provider @@ -119,6 +127,20 @@ func IsForceDestroy() bool { return mc.forceDestroy } func SpotPriceIncreaseRate() int { return mc.spotPriceIncreaseRate } +func IsRemote() bool { return mc.remote } + +func CommonOptions(ctx *pulumi.Context) (co []pulumi.ResourceOption) { + // Check if provider requires customization + cp, err := mc.provider.Custom(ctx) + if cp != nil { + co = append(co, pulumi.Provider(*cp)) + } + if err != nil { + logging.Errorf("Error registering custom provider %v", err) + } + return +} + // It will create a runID // if context has been intialized it will set it as the runID for the context // otherwise it will return the value (one time value) diff --git a/pkg/provider/aws/action/fedora/fedora.go b/pkg/provider/aws/action/fedora/fedora.go index 30bcf8a14..f9aad8379 100644 --- a/pkg/provider/aws/action/fedora/fedora.go +++ b/pkg/provider/aws/action/fedora/fedora.go @@ -235,6 +235,7 @@ func (r *fedoraRequest) deploy(ctx *pulumi.Context) error { c.GetHostIP(!*r.airgap)) if len(*r.timeout) > 0 { if err = serverless.OneTimeDelayedTask(ctx, + fmt.Sprintf("fedora-timeout-%s", maptContext.RunID()), *r.allocationData.Region, *r.prefix, awsFedoraDedicatedID, fmt.Sprintf("aws %s destroy --project-name %s --backed-url %s --serverless", diff --git a/pkg/provider/aws/action/kind/kind.go b/pkg/provider/aws/action/kind/kind.go index f438a7be4..058e1c512 100644 --- a/pkg/provider/aws/action/kind/kind.go +++ b/pkg/provider/aws/action/kind/kind.go @@ -194,6 +194,7 @@ func (r *kindRequest) deploy(ctx *pulumi.Context) error { c.GetHostIP(true)) if len(*r.timeout) > 0 { if err = serverless.OneTimeDelayedTask(ctx, + fmt.Sprintf("kind-destroy-%s", maptContext.RunID()), *r.allocationData.Region, *r.prefix, awsKindID, fmt.Sprintf("aws %s destroy --project-name %s --backed-url %s --serverless --force-destroy", diff --git a/pkg/provider/aws/action/mac-pool/housekeeper.go b/pkg/provider/aws/action/mac-pool/housekeeper.go new file mode 100644 index 000000000..9726349d5 --- /dev/null +++ b/pkg/provider/aws/action/mac-pool/housekeeper.go @@ -0,0 +1,138 @@ +package macpool + +import ( + "fmt" + "strings" + + maptContext "github.com/redhat-developer/mapt/pkg/manager/context" + "github.com/redhat-developer/mapt/pkg/provider/aws" + "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac" + macHost "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/host" + "github.com/redhat-developer/mapt/pkg/util" + "github.com/redhat-developer/mapt/pkg/util/logging" +) + +// House keeper is the function executed serverless to check if is there any +// machine non locked which had been running more than 24h. +// It should check if capacity allows to remove the machine +func houseKeeper(ctx *maptContext.ContextArgs, r *HouseKeepRequestArgs) error { + // Create mapt Context, this is a special case where we need change the context + // based on the operation + if err := maptContext.Init(ctx, aws.Provider()); err != nil { + return err + } + // Get full info on the pool + p, err := getPool(r.Pool.Name, r.Pool.Architecture, r.Pool.OSVersion) + if err != nil { + return err + } + p.maxSize = r.Pool.MaxSize + p.offeredCapacity = r.Pool.OfferedCapacity + logging.Debugf("Current pool: %s", p.print()) + // Pool under expected offered capacity + if p.currentOfferedCapacity() < r.Pool.OfferedCapacity { + if p.currentPoolSize() < r.Pool.MaxSize { + logging.Debug("house keeper will try to add machines as offered capacity is lower than expected") + maptContext.SetProjectName(r.Pool.Name) + return r.addCapacity(p) + } + // if number of machines in the pool + to max machines + // we do nothing + logging.Debug("house keeper will not do any action as pool size is currently at max size") + return nil + } + // Pool over expected offered capacity need to destroy machines + if p.currentOfferedCapacity() > r.Pool.OfferedCapacity { + if len(p.destroyableMachines) > 0 { + logging.Debug("house keeper will try to destroy machines as offered capacity is higher than expected") + // Need to check if any offered can be destroy + return r.destroyCapacity(p) + } + } + logging.Debug("house keeper will not do any action as offered capacity is met by the pool") + // Otherwise nonLockedMachines meet Capacity so we do nothing + return nil +} + +func (r *HouseKeepRequestArgs) addMachinesToPool(n int) error { + if err := validateBackedURL(); err != nil { + return err + } + for i := 0; i < n; i++ { + hr := r.fillHostRequest() + dh, err := macHost.CreatePoolDedicatedHost(hr) + if err != nil { + return err + } + mr := r.fillMacRequest() + if err = mr.CreateAvailableMacMachine(dh); err != nil { + return err + } + } + return nil +} + +// format for remote backed url when creating the dedicated host +// the backed url from param is used as base and the ID is appended as sub path +func validateBackedURL() error { + if strings.Contains(maptContext.BackedURL(), "file://") { + return fmt.Errorf("local backed url is not allowed for mac pool") + } + return nil +} + +// transform pool request to host request +// need if we need to expand the pool +func (r *HouseKeepRequestArgs) fillHostRequest() *macHost.PoolMacDedicatedHostRequestArgs { + return &macHost.PoolMacDedicatedHostRequestArgs{ + MacDedicatedHost: &macHost.MacDedicatedHostRequestArgs{ + Prefix: r.Pool.Prefix, + Architecture: r.Pool.Architecture, + // FixedLocation: r.FixedLocation, + VPCID: &r.Machine.VPCID, + SSHSGID: &r.Machine.SSHSGID, + }, + PoolID: &macHost.PoolID{ + PoolName: r.Pool.Name, + Arch: r.Pool.Architecture, + OSVersion: r.Pool.OSVersion, + }, + BackedURL: fmt.Sprintf("%s/%s", + maptContext.BackedURL(), + util.RandomID("mapt")), + } +} + +// If we need less or equal than the max allowed on the pool we create all of them +// if need are more than allowed we can create just the allowed +func (r *HouseKeepRequestArgs) addCapacity(p *pool) error { + machinesToAdd := p.offeredCapacity - p.currentOfferedCapacity() + if machinesToAdd+p.currentPoolSize() > p.maxSize { + machinesToAdd = p.maxSize - p.currentPoolSize() + } + logging.Debugf("Adding %d machines", machinesToAdd) + return r.addMachinesToPool(machinesToAdd) +} + +// If we need less or equal than the max allowed on the pool we create all of them +// if need are more than allowed we can create just the allowed +// TODO review allocation time is on the wrong order +func (r *HouseKeepRequestArgs) destroyCapacity(p *pool) error { + machinesToDestroy := p.currentOfferedCapacity() - r.Pool.OfferedCapacity + for i := 0; i < machinesToDestroy; i++ { + m := p.destroyableMachines[i] + // TODO change this + maptContext.SetProjectName(*m.ProjectName) + if err := aws.DestroyStack(aws.DestroyStackRequest{ + Stackname: mac.StackMacMachine, + Region: *m.Region, + BackedURL: *m.BackedURL, + }); err != nil { + return err + } + if err := macHost.DestroyPoolDedicatedHost(&r.Pool.Prefix); err != nil { + return err + } + } + return nil +} diff --git a/pkg/provider/aws/action/mac-pool/mac-pool.go b/pkg/provider/aws/action/mac-pool/mac-pool.go index a557b42da..e025f5d95 100644 --- a/pkg/provider/aws/action/mac-pool/mac-pool.go +++ b/pkg/provider/aws/action/mac-pool/mac-pool.go @@ -1,398 +1,131 @@ package macpool import ( - "encoding/json" - "fmt" - "strings" - "time" + "os" + "github.com/pulumi/pulumi/sdk/v3/go/auto" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/redhat-developer/mapt/pkg/manager" maptContext "github.com/redhat-developer/mapt/pkg/manager/context" "github.com/redhat-developer/mapt/pkg/provider/aws" "github.com/redhat-developer/mapt/pkg/provider/aws/modules/iam" - "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac" - macHost "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/host" - macMachine "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/machine" + macPool "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/pool" macUtil "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/util" - "github.com/redhat-developer/mapt/pkg/provider/aws/modules/serverless" - "github.com/redhat-developer/mapt/pkg/provider/aws/services/tag" - "github.com/redhat-developer/mapt/pkg/util" "github.com/redhat-developer/mapt/pkg/util/logging" + resourcesUtil "github.com/redhat-developer/mapt/pkg/util/resources" ) +const ( + stackName = "stackMacPool" + awsMacPoolID = "amp" +) + +// func Create(ctx *maptContext.ContextArgs, r *PoolRequestArgs) error { +// logging.Debug("Run mac pool create") +// // Create mapt Context +// if err := maptContext.Init(ctx, aws.Provider()); err != nil { +// return err +// } +// re := os.Getenv("AWS_DEFAULT_REGION") +// it := "c5d.xlarge" +// dhArgs := dedicatedhost.DedicatedHostArgs{ +// Region: &re, +// InstanceType: &it, +// Tags: map[string]string{"test": "test"}, +// } +// burl := maptContext.BackedURL() +// _, err := dedicatedhost.Create(&burl, false, &dhArgs) +// return err +// } + +// func Destroy(ctx *maptContext.ContextArgs) (err error) { +// logging.Debug("Run mac pool destroy") +// // Create mapt Context +// if err := maptContext.Init(ctx, aws.Provider()); err != nil { +// return err +// } +// return dedicatedhost.Destroy(nil) +// } + // Create works as an orchestrator for create n machines based on offered capacity // if pool already exists just change the params for the HouseKeeper // also the HouseKeep will take care of regulate the capacity // Even if we want to destroy the pool we will set params to max size 0 -func Create(ctx *maptContext.ContextArgs, r *MacPoolRequestArgs) error { +func Create(ctx *maptContext.ContextArgs, r *PoolRequestArgs) error { + logging.Debug("Run mac pool create") // Create mapt Context if err := maptContext.Init(ctx, aws.Provider()); err != nil { return err } - if err := r.addMachinesToPool(r.OfferedCapacity); err != nil { - return err + cs := manager.Stack{ + StackName: maptContext.StackNameByProject(stackName), + ProjectName: maptContext.ProjectName(), + BackedURL: maptContext.BackedURL(), + ProviderCredentials: aws.DefaultCredentials, + DeployFunc: r.deploy, } - if err := r.scheduleHouseKeeper(); err != nil { - return err - } - return r.requestReleaserAccount() + sr, _ := manager.UpStack(cs) + return r.results(sr) } -// TODO decide how to destroy machines in the pool as they may need to wait to reach 24 hours -func Destroy(ctx *maptContext.ContextArgs) error { +func Destroy(ctx *maptContext.ContextArgs) (err error) { + logging.Debug("Run mac pool destroy") // Create mapt Context if err := maptContext.Init(ctx, aws.Provider()); err != nil { return err } - if err := iam.Destroy(); err != nil { - return err - } - return serverless.Destroy() + return aws.DestroyStack( + aws.DestroyStackRequest{ + Stackname: stackName, + }) } // House keeper is the function executed serverless to check if is there any // machine non locked which had been running more than 24h. // It should check if capacity allows to remove the machine -func HouseKeeper(ctx *maptContext.ContextArgs, r *MacPoolRequestArgs) error { - // Create mapt Context, this is a special case where we need change the context - // based on the operation - if err := maptContext.Init(ctx, aws.Provider()); err != nil { - return err - } - - // Get full info on the pool - p, err := getPool(r.PoolName, r.Architecture, r.OSVersion) - if err != nil { - return err - } - // Pool under expected offered capacity - if p.currentOfferedCapacity() < r.OfferedCapacity { - if p.currentPoolSize() < r.MaxSize { - logging.Debug("house keeper will try to add machines as offered capacity is lower than expected") - maptContext.SetProjectName(r.PoolName) - return r.addCapacity(p) - } - // if number of machines in the pool + to max machines - // we do nothing - logging.Debug("house keeper will not do any action as pool size is currently at max size") - return nil - } - // Pool over expected offered capacity need to destroy machines - if p.currentOfferedCapacity() > r.OfferedCapacity { - if len(p.destroyableMachines) > 0 { - logging.Debug("house keeper will try to destroy machines as offered capacity is higher than expected") - // Need to check if any offered can be destroy - return r.destroyCapacity(p) - } - } - logging.Debug("house keeper will not do any action as offered capacity is met by the pool") - // Otherwise nonLockedMachines meet Capacity so we do nothing - return nil +func HouseKeeper(ctx *maptContext.ContextArgs, r *HouseKeepRequestArgs) error { + return houseKeeper(ctx, r) } func Request(ctx *maptContext.ContextArgs, r *RequestMachineArgs) error { - // First get full info on the pool and the next machine for request - p, err := getPool(r.PoolName, r.Architecture, r.OSVersion) - if err != nil { - return err - } - hi, err := p.getNextMachineForRequest() - if err != nil { - return err - } - - // Create mapt Context - ctx.ProjectName = *hi.ProjectName - ctx.BackedURL = *hi.BackedURL - if err := maptContext.Init(ctx, aws.Provider()); err != nil { - return err - } - - mr := macMachine.Request{ - Prefix: *hi.Prefix, - Version: *hi.OSVersion, - Architecture: *hi.Arch, - Timeout: r.Timeout, - } - - // TODO here we would change based on the integration-mode requested - // possible values remote-shh, gh-selfhosted-runner, cirrus-persistent-worker - err = mr.ManageRequest(hi) - if err != nil { - return err - } - - // We update the runID on the dedicated host - return tag.Update(maptContext.TagKeyRunID, - maptContext.RunID(), - *hi.Region, - *hi.Host.HostId) -} - -func Release(ctx *maptContext.ContextArgs, hostID string) error { - return macUtil.Release(ctx, hostID) -} - -func (r *MacPoolRequestArgs) addMachinesToPool(n int) error { - if err := validateBackedURL(); err != nil { - return err - } - for i := 0; i < n; i++ { - hr := r.fillHostRequest() - dh, err := macHost.CreatePoolDedicatedHost(hr) + // If remote run through serverless + if ctx.Remote { + // Generate ticket + ticket, err := ticket() if err != nil { return err } - mr := r.fillMacRequest() - if err = mr.CreateAvailableMacMachine(dh); err != nil { - return err - } - } - return nil -} - -// Run serverless operation for house keeping -func (r *MacPoolRequestArgs) scheduleHouseKeeper() error { - return serverless.Create( - getHouseKeepingCommand( - r.PoolName, - r.Architecture, - r.OSVersion, - r.OfferedCapacity, - r.MaxSize, - r.FixedLocation), - serverless.Repeat, - houseKeepingInterval, - fmt.Sprintf("%s-%s-%s", - r.PoolName, - r.Architecture, - r.OSVersion)) -} - -func getHouseKeepingCommand(poolName, arch, osVersion string, - offeredCapacity, maxSize int, - fixedLocation bool) string { - cmd := fmt.Sprintf(houseKeepingCommand, - poolName, arch, osVersion, - offeredCapacity, maxSize) - if fixedLocation { - cmd += houseKeepingFixedLocationParam - } - return cmd -} - -// If we need less or equal than the max allowed on the pool we create all of them -// if need are more than allowed we can create just the allowed -func (r *MacPoolRequestArgs) addCapacity(p *pool) error { - allowed := p.maxSize - p.offeredCapacity - needed := p.offeredCapacity - p.currentOfferedCapacity() - if needed <= allowed { - return r.addMachinesToPool(needed) - } - return r.addMachinesToPool(allowed) -} - -// If we need less or equal than the max allowed on the pool we create all of them -// if need are more than allowed we can create just the allowed -// TODO review allocation time is on the wrong order -func (r *MacPoolRequestArgs) destroyCapacity(p *pool) error { - machinesToDestroy := p.currentOfferedCapacity() - r.OfferedCapacity - for i := 0; i < machinesToDestroy; i++ { - m := p.destroyableMachines[i] - // TODO change this - maptContext.SetProjectName(*m.ProjectName) - if err := aws.DestroyStack(aws.DestroyStackRequest{ - Stackname: mac.StackMacMachine, - Region: *m.Region, - BackedURL: *m.BackedURL, - }); err != nil { - return err - } - if err := aws.DestroyStack(aws.DestroyStackRequest{ - Stackname: mac.StackDedicatedHost, - // TODO check if needed to add region for backedURL - Region: *m.Region, - BackedURL: *m.BackedURL, - }); err != nil { + if err = macPool.RequestRemote(ctx, &r.PoolName, &r.Architecture, &r.OSVersion, ticket); err != nil { return err } + return writeTicket(ticket) } - return nil + return request(ctx, r) } -// format for remote backed url when creating the dedicated host -// the backed url from param is used as base and the ID is appended as sub path -func validateBackedURL() error { - if strings.Contains(maptContext.BackedURL(), "file://") { - return fmt.Errorf("local backed url is not allowed for mac pool") +func Release(ctx *maptContext.ContextArgs, m *MachineRequestArgs, ticket string) error { + // If remote run through serverless + if ctx.Remote { + return macPool.ReleaseRemote(ctx, ticket) } - return nil + return macUtil.Release(ctx, ticket) } -// This function will fill information about machines in the pool -// depending on their state and age full fill the struct to easily -// manage them -func getPool(poolName, arch, osVersion string) (*pool, error) { - // Get machines in the pool - poolID := &macHost.PoolID{ - PoolName: poolName, - Arch: arch, - OSVersion: osVersion, - } - var p pool - var err error - p.machines, err = macHost.GetPoolDedicatedHostsInformation(poolID) - if err != nil { - return nil, err - } - // non-locked - p.currentOfferedMachines = util.ArrayFilter(p.machines, - func(h *mac.HostInformation) bool { - isLocked, err := macUtil.IsMachineLocked(h) - if err != nil { - logging.Errorf("error checking locking for machine %s", *h.Host.AssetId) - return false - } - return !isLocked +func (r *PoolRequestArgs) deploy(ctx *pulumi.Context) error { + _, err := macPool.NewPool(ctx, + resourcesUtil.GetResourceName(r.Prefix, awsMacPoolID, "mac-pool"), + &macPool.PoolArgs{ + Region: os.Getenv("AWS_DEFAULT_REGION"), + Name: r.Name, + Arch: r.Architecture, + OSVersion: r.OSVersion, + OfferedCapacity: r.OfferedCapacity, + MaxSize: r.MaxSize, }) - // non-locked + older than 24 hours - macAgeDestroyRequeriemnt := time.Now().UTC(). - Add(-24 * time.Hour) - p.destroyableMachines = util.ArrayFilter(p.currentOfferedMachines, - func(h *mac.HostInformation) bool { - return h.Host.AllocationTime.UTC().Before(macAgeDestroyRequeriemnt) - }) - p.name = poolName - return &p, nil -} - -// This is a boilerplate function to pick the best machine for -// next request, initially we just pick the newest machine from the -// offered machines, may we can optimize this -func (p *pool) getNextMachineForRequest() (*mac.HostInformation, error) { - if len(p.currentOfferedMachines) == 0 { - return nil, fmt.Errorf("no available machines to process the request") - } - mp := len(p.currentOfferedMachines) - 1 - return p.currentOfferedMachines[mp], nil -} - -// transform pool request to host request -// need if we need to expand the pool -func (r *MacPoolRequestArgs) fillHostRequest() *macHost.PoolMacDedicatedHostRequestArgs { - return &macHost.PoolMacDedicatedHostRequestArgs{ - MacDedicatedHost: &macHost.MacDedicatedHostRequestArgs{ - Prefix: r.Prefix, - Architecture: r.Architecture, - FixedLocation: r.FixedLocation, - }, - PoolID: &macHost.PoolID{ - PoolName: r.PoolName, - Arch: r.Architecture, - OSVersion: r.OSVersion, - }, - BackedURL: fmt.Sprintf("%s/%s", - maptContext.BackedURL(), - util.RandomID("mapt")), - } + return err } -// transform pool request to machine request -// need if we need to expand the pool -func (r *MacPoolRequestArgs) fillMacRequest() *macMachine.Request { - return &macMachine.Request{ - Prefix: r.Prefix, - Architecture: r.Architecture, - Version: r.OSVersion, - // SetupGHActionsRunner: r.SetupGHActionsRunner, - // Airgap: r.Airgap, - } -} - -// Create an user and a pair of automation credentials to add on cicd system of choice -// to execute request and release operation with minimum rights -func (r *MacPoolRequestArgs) requestReleaserAccount() error { - pc, err := requestReleaserPolicy() - if err != nil { - return err - } - return iam.Create( - fmt.Sprintf("%s-%s-%s", - r.PoolName, - r.Architecture, - r.OSVersion), - pc) -} - -// This is only used during create to create a policy content allowing to -// run request and release operations. Helping to reduce the iam rights required -// to make use for the mac pool service from an user point of view -func requestReleaserPolicy() (*string, error) { - // For mac pool service all macs will be a sub path for the backed url - // set during create - bucketPath := strings.TrimPrefix(maptContext.BackedURL(), "s3://") - bucket := strings.Split(bucketPath, "/")[0] - pc, err := json.Marshal(map[string]interface{}{ - "Version": "2012-10-17", - "Statement": []map[string]interface{}{ - { - "Effect": "Allow", - "Action": []string{ - "ec2:CreateSecurityGroup", - "ec2:DeleteSecurityGroup", - "ec2:AuthorizeSecurityGroupIngress", - "ec2:RevokeSecurityGroupIngress", - "ec2:ModifyInstanceAttribute", - "ec2:CreateReplaceRootVolumeTask", - "ec2:CreateTags", - "ec2:DeleteTags", - "ec2:Describe*", - "ec2:ImportKeyPair", - "ec2:DeleteKeyPair", - "cloudformation:GetResource", - "scheduler:GetSchedule", - "cloudformation:DeleteResource", - "cloudformation:GetResourceRequestStatus", - }, - "Resource": []string{ - "*", - }, - }, - { - "Effect": "Allow", - "Action": []string{ - "ec2:CreateSnapshot", - "ec2:CreateVolume", - "ec2:DetachVolume", - "ec2:AttachVolume", - }, - "Resource": []string{ - "*", - }, - }, - { - "Effect": "Allow", - "Action": []string{ - "s3:PutBucketPolicy", - "s3:PutObjectAcl", - "s3:GetBucketPolicy", - "s3:PutObject", - "s3:DeleteObject", - "s3:ListBucket", - "s3:GetObject", - "s3:GetBucketLocation", - }, - "Resource": []string{ - fmt.Sprintf("arn:aws:s3:::%s", bucket), - fmt.Sprintf("arn:aws:s3:::%s", bucketPath), - fmt.Sprintf("arn:aws:s3:::%s/*", bucketPath), - }, - }, - }, - }) - if err != nil { - return nil, err - } - policy := string(pc) - return &policy, nil +func (r *PoolRequestArgs) results(stackResult auto.UpResult) error { + return iam.Results(stackResult, r.Name) } diff --git a/pkg/provider/aws/action/mac-pool/request.go b/pkg/provider/aws/action/mac-pool/request.go new file mode 100644 index 000000000..434c6632f --- /dev/null +++ b/pkg/provider/aws/action/mac-pool/request.go @@ -0,0 +1,112 @@ +package macpool + +import ( + "fmt" + + maptContext "github.com/redhat-developer/mapt/pkg/manager/context" + "github.com/redhat-developer/mapt/pkg/provider/aws" + "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac" + macMachine "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/machine" + "github.com/redhat-developer/mapt/pkg/provider/aws/services/tag" +) + +func request(ctx *maptContext.ContextArgs, r *RequestMachineArgs) error { + if len(r.Ticket) == 0 { + // Generate ticket + ticket, err := ticket() + if err != nil { + return err + } + r.Ticket = *ticket + } + // First get full info on the pool and the next machine for request + p, err := getPool(r.PoolName, r.Architecture, r.OSVersion) + if err != nil { + return err + } + hi, err := p.getNextMachineForRequest() + if err != nil { + return err + } + + // Create mapt Context + ctx.ProjectName = *hi.ProjectName + ctx.BackedURL = *hi.BackedURL + if err := maptContext.Init(ctx, aws.Provider()); err != nil { + return err + } + + mr := macMachine.Request{ + Prefix: *hi.Prefix, + Version: *hi.OSVersion, + Architecture: *hi.Arch, + VPCID: &r.Machine.VPCID, + SSHSGID: &r.Machine.SSHSGID, + Timeout: r.Timeout, + } + + // TODO here we would change based on the integration-mode requested + // possible values remote-shh, gh-selfhosted-runner, cirrus-persistent-worker + err = mr.ManageRequest(hi) + if err != nil { + return err + } + + // We update the runID on the dedicated host + err = tag.Update(maptContext.TagKeyRunID, + maptContext.RunID(), + *hi.Region, + *hi.Host.HostId) + if err != nil { + return err + } + return writeTicket(&r.Ticket) +} + +// func requestRemote(ctx *maptContext.ContextArgs, r *RequestMachineArgs) error { +// if err := maptContext.Init(ctx, aws.Provider()); err != nil { +// return err +// } +// rARNs, err := data.GetResourcesMatchingTags( +// data.ResourceTypeECS, +// requestTags( +// r.PoolName, +// r.Architecture, +// r.OSVersion)) +// if err != nil { +// return err +// } +// err = tag.Update(macConstants.TagKeyTicket, +// r.Ticket, +// *hi.Region, +// *hi.Host.HostId) +// if err != nil { +// return err +// } +// return writeTicket(&r.Ticket) +// } + +// This is a boilerplate function to pick the best machine for +// next request, initially we just pick the newest machine from the +// offered machines, may we can optimize this +func (p *pool) getNextMachineForRequest() (*mac.HostInformation, error) { + if len(p.currentOfferedMachines) == 0 { + return nil, fmt.Errorf("no available machines to process the request") + } + mp := len(p.currentOfferedMachines) - 1 + return p.currentOfferedMachines[mp], nil +} + +// transform pool request to machine request +// need if we need to expand the pool +func (r *HouseKeepRequestArgs) fillMacRequest() *macMachine.Request { + return &macMachine.Request{ + Prefix: r.Pool.Prefix, + Architecture: r.Pool.Architecture, + Version: r.Pool.OSVersion, + // Network and Security + VPCID: &r.Machine.VPCID, + // SubnetID: &r.Machine.SubnetID, + SSHSGID: &r.Machine.SSHSGID, + } +} diff --git a/pkg/provider/aws/action/mac-pool/types.go b/pkg/provider/aws/action/mac-pool/types.go index ea7976a17..0d39e048d 100644 --- a/pkg/provider/aws/action/mac-pool/types.go +++ b/pkg/provider/aws/action/mac-pool/types.go @@ -1,24 +1,20 @@ package macpool import ( - "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac" -) + "fmt" -const ( - houseKeepingCommand = "aws mac-pool house-keep --name %s --arch %s --version %s --offered-capacity %d --max-size %d --serverless " - houseKeepingFixedLocationParam = "--fixed-location " - // https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html#eb-rate-expressions - houseKeepingInterval = "27 minutes" + "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac" + "github.com/redhat-developer/mapt/pkg/util" ) -type MacPoolRequestArgs struct { +type PoolRequestArgs struct { // Prefix for the resources related to mac // this is relevant in case of an orchestration with multiple // macs on the same stack Prefix string // Pool specs - PoolName string + Name string Architecture string OSVersion string // Pool params @@ -28,28 +24,37 @@ type MacPoolRequestArgs struct { // Max is the max capacity of machines in the pool. Even if capacity is not meet if number of machines // are equal to max it will not create more machines MaxSize int - // If fixed location is set machines only created on current region, in case no capacity it will not - // create on different regions - FixedLocation bool +} + +// Custom values to setup within machines in the cluster +type MachineRequestArgs struct { + VPCID string + // This values now will be calculated + // AZID string + // SubnetID string + SSHSGID string +} + +type HouseKeepRequestArgs struct { + // Pool identification and capacity + Pool *PoolRequestArgs + // House keeper requires extra info for setup network and security for managed machines + Machine *MachineRequestArgs } type RequestMachineArgs struct { + // Pool identification PoolName string Architecture string OSVersion string + // Ticket to assing the dedicated host + Ticket string + // Request needs this information to manage the machine + Machine *MachineRequestArgs // If timeout is set a severless scheduled task will be created to self destroy the resources Timeout string } -type ReleaseMachineArgs struct { -} - -// type PoolID struct { -// PoolName string -// Arch string -// OSVersion string -// } - type pool struct { // pool params name string @@ -65,5 +70,20 @@ type pool struct { destroyableMachines []*mac.HostInformation } -func (p *pool) currentOfferedCapacity() int { return len(p.currentOfferedMachines) } -func (p *pool) currentPoolSize() int { return len(p.machines) } +func (p *pool) currentOfferedCapacity() int { + return util.If(p.currentOfferedMachines == nil, + 0, + len(p.currentOfferedMachines)) +} + +func (p *pool) currentPoolSize() int { + return util.If( + p.machines == nil, + 0, + len(p.machines)) +} + +func (p *pool) print() string { + return fmt.Sprintf("name: %s, offeredCapacity: %d, maxSize: %d, currentOfferedCapacity: %d, currentSize: %d", + p.name, p.offeredCapacity, p.maxSize, p.currentOfferedCapacity(), p.currentPoolSize()) +} diff --git a/pkg/provider/aws/action/mac-pool/util.go b/pkg/provider/aws/action/mac-pool/util.go new file mode 100644 index 000000000..328ce2482 --- /dev/null +++ b/pkg/provider/aws/action/mac-pool/util.go @@ -0,0 +1,73 @@ +package macpool + +import ( + "crypto/rand" + "encoding/binary" + "fmt" + "os" + "path" + "time" + + maptContext "github.com/redhat-developer/mapt/pkg/manager/context" + "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac" + macHost "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/host" + macUtil "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/util" + "github.com/redhat-developer/mapt/pkg/util" + "github.com/redhat-developer/mapt/pkg/util/logging" +) + +// This function will fill information about machines in the pool +// depending on their state and age full fill the struct to easily +// manage them +func getPool(poolName, arch, osVersion string) (*pool, error) { + // Get machines in the pool + poolID := &macHost.PoolID{ + PoolName: poolName, + Arch: arch, + OSVersion: osVersion, + } + var p pool + var err error + p.machines, err = macHost.GetPoolDedicatedHostsInformation(poolID) + if err != nil { + return nil, err + } + // non-locked + p.currentOfferedMachines = util.ArrayFilter(p.machines, + func(h *mac.HostInformation) bool { + isLocked, err := macUtil.IsMachineLocked(h) + if err != nil { + logging.Errorf("error checking locking for machine %s", *h.Host.AssetId) + return false + } + return !isLocked + }) + // non-locked + older than 24 hours + macAgeDestroyRequeriemnt := time.Now().UTC(). + Add(-24 * time.Hour) + p.destroyableMachines = util.ArrayFilter(p.currentOfferedMachines, + func(h *mac.HostInformation) bool { + return h.Host.AllocationTime.UTC().Before(macAgeDestroyRequeriemnt) + }) + p.name = poolName + return &p, nil +} + +func ticket() (*string, error) { + timestamp := time.Now().UnixNano() / 1e6 + var randomBytes [2]byte + _, err := rand.Read(randomBytes[:]) + if err != nil { + return nil, err + } + randomPart := binary.BigEndian.Uint16(randomBytes[:]) + + ticket := fmt.Sprintf("%d%04d", timestamp, randomPart) + return &ticket, nil +} + +func writeTicket(ticket *string) error { + return util.If(len(maptContext.GetResultsOutputPath()) > 0, + os.WriteFile(path.Join(maptContext.GetResultsOutputPath(), "ticket"), []byte(*ticket), 0600), + nil) +} diff --git a/pkg/provider/aws/action/mac/mac.go b/pkg/provider/aws/action/mac/mac.go index 7796d692b..3e5b6a54f 100644 --- a/pkg/provider/aws/action/mac/mac.go +++ b/pkg/provider/aws/action/mac/mac.go @@ -162,9 +162,9 @@ func create(r *MacRequestArgs, dh *mac.HostInformation) (err error) { func (r *MacRequestArgs) fillHostRequest() *macHost.MacDedicatedHostRequestArgs { return &macHost.MacDedicatedHostRequestArgs{ - Prefix: r.Prefix, - Architecture: r.Architecture, - FixedLocation: r.FixedLocation, + Prefix: r.Prefix, + Architecture: r.Architecture, + // FixedLocation: r.FixedLocation, } } diff --git a/pkg/provider/aws/action/openshift-snc/openshift-snc.go b/pkg/provider/aws/action/openshift-snc/openshift-snc.go index 6d6af0386..2364229be 100644 --- a/pkg/provider/aws/action/openshift-snc/openshift-snc.go +++ b/pkg/provider/aws/action/openshift-snc/openshift-snc.go @@ -234,6 +234,7 @@ func (r *openshiftSNCRequest) deploy(ctx *pulumi.Context) error { c.GetHostIP(true)) if len(*r.timeout) > 0 { if err = serverless.OneTimeDelayedTask(ctx, + fmt.Sprintf("openshift-snc-destroy-%s", maptContext.RunID()), *r.allocationData.Region, *r.prefix, awsOCPSNCID, fmt.Sprintf("aws %s destroy --project-name %s --backed-url %s --serverless", diff --git a/pkg/provider/aws/action/rhel/rhel.go b/pkg/provider/aws/action/rhel/rhel.go index 7a1f2e164..373726319 100644 --- a/pkg/provider/aws/action/rhel/rhel.go +++ b/pkg/provider/aws/action/rhel/rhel.go @@ -240,7 +240,9 @@ func (r *rhelRequest) deploy(ctx *pulumi.Context) error { ctx.Export(fmt.Sprintf("%s-%s", *r.prefix, outputHost), c.GetHostIP(!*r.airgap)) if len(*r.timeout) > 0 { - if err = serverless.OneTimeDelayedTask(ctx, + if err = serverless.OneTimeDelayedTask( + ctx, + fmt.Sprintf("rhel-timeout-%s", maptContext.RunID()), *r.allocationData.Region, *r.prefix, awsRHELDedicatedID, fmt.Sprintf("aws %s destroy --project-name %s --backed-url %s --serverless", diff --git a/pkg/provider/aws/action/windows/windows.go b/pkg/provider/aws/action/windows/windows.go index f07176d61..81003f44a 100644 --- a/pkg/provider/aws/action/windows/windows.go +++ b/pkg/provider/aws/action/windows/windows.go @@ -293,6 +293,7 @@ func (r *windowsServerRequest) deploy(ctx *pulumi.Context) error { c.GetHostIP(!*r.airgap)) if len(*r.timeout) > 0 { if err = serverless.OneTimeDelayedTask(ctx, + fmt.Sprintf("windows-timeout-%s", maptContext.RunID()), *r.allocationData.Region, *r.prefix, awsWindowsDedicatedID, fmt.Sprintf("aws %s destroy --project-name %s --backed-url %s --serverless", diff --git a/pkg/provider/aws/aws.go b/pkg/provider/aws/aws.go index 36f96c2c2..644beae48 100644 --- a/pkg/provider/aws/aws.go +++ b/pkg/provider/aws/aws.go @@ -12,7 +12,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsEC2Types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + awsConfig "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" "github.com/pulumi/pulumi/sdk/v3/go/auto" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/redhat-developer/mapt/pkg/manager" maptContext "github.com/redhat-developer/mapt/pkg/manager/context" "github.com/redhat-developer/mapt/pkg/manager/credentials" @@ -26,7 +28,9 @@ import ( const pulumiLocksPath = ".pulumi/locks" -type AWS struct{} +type AWS struct { + cp *pulumi.ProviderResource +} func (a *AWS) Init(backedURL string) error { // Manage remote state requirements, if backedURL @@ -35,6 +39,28 @@ func (a *AWS) Init(backedURL string) error { return manageRemoteState(backedURL) } +func (a *AWS) Custom(ctx *pulumi.Context) (*pulumi.ProviderResource, error) { + if a.cp != nil { + return a.cp, nil + } + if maptContext.IsServerless() { + cp, err := awsConfig.NewProvider(ctx, + "aws-serverless-custom-args", + &awsConfig.ProviderArgs{ + SkipCredentialsValidation: pulumi.Bool(true), + SkipRequestingAccountId: pulumi.Bool(true), + MaxRetries: pulumi.Int(1), + }) + if err != nil { + return nil, err + } + var pr pulumi.ProviderResource = cp + a.cp = &pr + return a.cp, nil + } + return nil, nil +} + func Provider() *AWS { return &AWS{} } @@ -101,9 +127,10 @@ func SetAWSCredentials(ctx context.Context, stack auto.Stack, customCredentials } type DestroyStackRequest struct { - Region string - BackedURL string - Stackname string + Region string + BackedURL string + ProjectName string + Stackname string } func DestroyStack(s DestroyStackRequest) error { @@ -127,8 +154,10 @@ func DestroyStack(s DestroyStackRequest) error { } } return manager.DestroyStack(manager.Stack{ - StackName: maptContext.StackNameByProject(s.Stackname), - ProjectName: maptContext.ProjectName(), + StackName: maptContext.StackNameByProject(s.Stackname), + ProjectName: util.If(len(s.ProjectName) > 0, + s.ProjectName, + maptContext.ProjectName()), BackedURL: util.If(len(s.BackedURL) > 0, s.BackedURL, maptContext.BackedURL()), diff --git a/pkg/provider/aws/data/azs.go b/pkg/provider/aws/data/azs.go index 488dd598d..7df122f28 100644 --- a/pkg/provider/aws/data/azs.go +++ b/pkg/provider/aws/data/azs.go @@ -26,8 +26,8 @@ func GetRandomAvailabilityZone(region string, excludedAZs []string) (*string, er return azs[util.Random(len(azs)-1, 0)].ZoneName, nil } -func GetAvailabilityZones() []string { - azs, err := describeAvailabilityZones("") +func GetAvailabilityZones(regionName string) []string { + azs, err := describeAvailabilityZones(regionName) if err != nil { logging.Error(err) return nil diff --git a/pkg/provider/aws/data/dedicatedhost.go b/pkg/provider/aws/data/dedicatedhost.go index 0effe8bb1..7601873c3 100644 --- a/pkg/provider/aws/data/dedicatedhost.go +++ b/pkg/provider/aws/data/dedicatedhost.go @@ -31,6 +31,19 @@ func GetDedicatedHost(hostID string) (*ec2Types.Host, error) { return &hosts[0], nil } +func GetDedicatedHostByTag(tags map[string]string) (*ec2Types.Host, error) { + hosts, err := GetDedicatedHosts(DedicatedHostResquest{ + Tags: tags, + }) + if err != nil { + return nil, err + } + if len(hosts) != 1 { + return nil, fmt.Errorf("error getting the dedicated host %v", tags) + } + return &hosts[0], nil +} + // This function check on all regions for the dedicated host // and return the list of hosts matching the request params func GetDedicatedHosts(r DedicatedHostResquest) ([]ec2Types.Host, error) { diff --git a/pkg/provider/aws/data/ecs.go b/pkg/provider/aws/data/ecs.go index ac82011f8..f542193b3 100644 --- a/pkg/provider/aws/data/ecs.go +++ b/pkg/provider/aws/data/ecs.go @@ -5,6 +5,9 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/service/ecs" + "github.com/aws/aws-sdk-go-v2/service/ecs/types" + "github.com/redhat-developer/mapt/pkg/util" + "golang.org/x/exp/slices" ) var ErrECSClusterNotFound = fmt.Errorf("cluster not found") @@ -39,3 +42,28 @@ func GetCluster(clusterName, region string) (*string, error) { } return nil, ErrECSClusterNotFound } + +func ActiveTasks(taskArns []string) (*string, error) { + cfg, err := getGlobalConfig() + if err != nil { + return nil, err + } + client := ecs.NewFromConfig(cfg) + tDefs, err := client.ListTaskDefinitions( + context.TODO(), + &ecs.ListTaskDefinitionsInput{ + Status: types.TaskDefinitionStatusActive, + }) + if err != nil { + return nil, err + } + activeTasks := util.ArrayFilter( + tDefs.TaskDefinitionArns, + func(arn string) bool { + return slices.Contains(taskArns, arn) + }) + if len(activeTasks) != 1 { + return nil, fmt.Errorf("there should be exactly one active task") + } + return &activeTasks[0], nil +} diff --git a/pkg/provider/aws/data/network.go b/pkg/provider/aws/data/network.go index 7c37e2e4d..2cedf1deb 100644 --- a/pkg/provider/aws/data/network.go +++ b/pkg/provider/aws/data/network.go @@ -117,3 +117,41 @@ func isPublic(client *ec2.Client, subnetID string) error { } return fmt.Errorf("no public subnet setup found") } + +type SubnetRequestArgs struct { + Region, VpcId, AzId *string +} + +// Get first subnet if azid is pass it will pick from it +// If vpc id is pass it will pick first from vpc id subnets +func GetSubnetID(args *SubnetRequestArgs) (*string, error) { + cfg, err := getConfig(*args.Region) + if err != nil { + return nil, err + } + ec2Client := ec2.NewFromConfig(cfg) + var filters []ec2types.Filter + if args.VpcId != nil { + filters = append(filters, ec2types.Filter{ + Name: aws.String("vpc-id"), + Values: []string{*args.VpcId}}) + } + if args.AzId != nil { + filters = append(filters, ec2types.Filter{ + Name: aws.String("availability-zone-id"), + Values: []string{*args.AzId}}) + } + output, err := ec2Client.DescribeSubnets( + context.TODO(), + &ec2.DescribeSubnetsInput{ + Filters: filters, + }) + if err != nil { + return nil, err + } + if len(output.Subnets) == 1 { + return output.Subnets[0].SubnetId, nil + } + // If we got several subnets (all for vpcId we get subnet random) + return output.Subnets[util.Random(len(output.Subnets), 0)].SubnetId, nil +} diff --git a/pkg/provider/aws/data/tags.go b/pkg/provider/aws/data/tags.go new file mode 100644 index 000000000..a49eddc66 --- /dev/null +++ b/pkg/provider/aws/data/tags.go @@ -0,0 +1,55 @@ +package data + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi" + "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types" + "github.com/redhat-developer/mapt/pkg/util" +) + +const ( + ResourceTypeECS = "ecs:task-definition" +) + +var ( + ErrorNoResourcesFound = fmt.Errorf("no resources matching tags") +) + +// Return a list of arns for the type of resource which have all tags +func GetResourcesMatchingTags(resourceType string, tags map[string]string) ([]string, error) { + cfg, err := getGlobalConfig() + if err != nil { + return nil, err + } + tagsClient := resourcegroupstaggingapi.NewFromConfig(cfg) + ro, err := tagsClient.GetResources(context.Background(), + &resourcegroupstaggingapi.GetResourcesInput{ + ResourceTypeFilters: []string{resourceType}, + }) + if err != nil { + return nil, err + } + rFiltered := util.ArrayFilter(ro.ResourceTagMappingList, + func(r types.ResourceTagMapping) bool { + ft := util.ArrayFilter(r.Tags, + func(rt types.Tag) bool { + for k, v := range tags { + if *rt.Key == k && *rt.Value == v { + return true + } + } + return false + }) + return len(tags) == len(ft) + }) + if len(rFiltered) == 0 { + return nil, ErrorNoResourcesFound + } + return util.ArrayConvert( + rFiltered, + func(rt types.ResourceTagMapping) string { + return *rt.ResourceARN + }), nil +} diff --git a/pkg/provider/aws/modules/ec2/compute/dedicated-host/dedicated-host.go b/pkg/provider/aws/modules/ec2/compute/dedicated-host/dedicated-host.go new file mode 100644 index 000000000..2cd8bd6dc --- /dev/null +++ b/pkg/provider/aws/modules/ec2/compute/dedicated-host/dedicated-host.go @@ -0,0 +1,232 @@ +package dedicatedhost + +import ( + "fmt" + "strings" + + ec2Types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" + "github.com/pulumi/pulumi/sdk/v3/go/auto" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/redhat-developer/mapt/pkg/manager" + maptContext "github.com/redhat-developer/mapt/pkg/manager/context" + "github.com/redhat-developer/mapt/pkg/provider/aws" + awsConstants "github.com/redhat-developer/mapt/pkg/provider/aws/constants" + "github.com/redhat-developer/mapt/pkg/provider/aws/data" + "github.com/redhat-developer/mapt/pkg/provider/aws/services/ec2/compute" + "github.com/redhat-developer/mapt/pkg/provider/util/output" + "github.com/redhat-developer/mapt/pkg/util" + "github.com/redhat-developer/mapt/pkg/util/logging" + utilMaps "github.com/redhat-developer/mapt/pkg/util/maps" + resourcesUtil "github.com/redhat-developer/mapt/pkg/util/resources" +) + +const ( + // mapt internal ID for the component: dedicated host + awsDH = "adh" + + outputDedicatedHostID = "adhDedicatedHostID" + outputDedicatedHostAZ = "adhDedicatedHostAZ" + outputRegion = "adhRegion" +) + +var ( + defaultPrefix = "mapt" + maptDHDefaultPrefix = "mapt-dh" +) + +type DedicatedHostArgs struct { + Prefix *string + Region *string + InstanceType *string + Tags map[string]string +} + +type dedicatedHostRequest struct { + prefix *string + region *string + azId *string + instanceType *string + hostId *string + tags map[string]string +} + +func (r *dedicatedHostRequest) tagsAsStringMapInput() pulumi.StringMap { + return utilMaps.Convert(r.tags, + func(name string) string { return name }, + func(value string) pulumi.StringInput { return pulumi.String(value) }) +} + +func Create(backedURL *string, exportOutputs bool, args *DedicatedHostArgs) (*ec2Types.Host, error) { + // here tags contains... + // all custom + dhTags := utilMaps.Append(maptContext.GetTags(), tags) + hostId, azId, err := dedicatedHost(args.Region, args.InstanceType, args.Tags) + if err != nil { + return nil, err + } + r := &dedicatedHostRequest{ + prefix: util.If(args.Prefix != nil, args.Prefix, &defaultPrefix), + region: args.Region, + azId: azId, + instanceType: args.InstanceType, + hostId: hostId, + tags: args.Tags, + } + cs := manager.Stack{ + StackName: maptContext.StackNameByProject(maptDHDefaultPrefix), + ProjectName: fmt.Sprintf("%s-%s", *r.prefix, maptContext.ProjectName()), + BackedURL: *backedURL, + ProviderCredentials: aws.GetClouProviderCredentials( + map[string]string{ + awsConstants.CONFIG_AWS_REGION: *args.Region}), + DeployFunc: r.deploy, + } + sr, err := manager.UpStack(cs) + if err != nil { + return nil, err + } + dhID, _, err := manageResultsDedicatedHost(sr, *r.prefix, exportOutputs) + if err != nil { + return nil, err + } + logging.Debugf("mac dedicated host with host id %s has been created successfully", *dhID) + return data.GetDedicatedHost(*dhID) +} + +func Destroy(prefix *string) (err error) { + logging.Debug("Destroy dedicated host resources") + if prefix == nil { + prefix = &defaultPrefix + } + // Get stack first and export host-id and region + regionId, dhId, err := getDedicatedHostData(prefix) + if err != nil { + return err + } + err = aws.DestroyStack( + aws.DestroyStackRequest{ + ProjectName: fmt.Sprintf("%s-%s", + *prefix, + maptContext.ProjectName()), + Stackname: maptContext.StackNameByProject(maptDHDefaultPrefix), + }) + if err != nil { + return err + } + return compute.DedicatedHostRelease(regionId, dhId) +} + +// Check for a dedicated host across the Azs on a region as we may hit no capacity and there is no way to check for it +// in advance +func dedicatedHost(region, instanceType *string, tags map[string]string) (hostId *string, azId *string, err error) { + azs := data.GetAvailabilityZones(*region) + var isOffered bool + for i := 0; !isOffered && i < len(azs); i++ { + isOffered, err = data.IsInstanceTypeOfferedByAZ(*region, *instanceType, azs[i]) + if err != nil { + return + } + if !isOffered { + logging.Debugf("Instancetype %s is not offered at %s", *instanceType, azs[i]) + continue + } + hostId, err = compute.DedicatedHost(region, &azs[i], instanceType, tags) + if err != nil { + if isCapacityError(err) { + isOffered = false + continue + } + } + azId = &azs[i] + return + } + if hostId == nil { + return nil, nil, fmt.Errorf("no capacity across the region") + } + return +} + +func isCapacityError(err error) bool { + return strings.Contains(err.Error(), "Insufficient") || + strings.Contains(err.Error(), "capacity") +} + +func getDedicatedHostData(prefix *string) (region *string, hostId *string, err error) { + s, err := manager.CheckStack( + manager.Stack{ + ProjectName: fmt.Sprintf("%s-%s", + *prefix, + maptContext.ProjectName()), + StackName: maptContext.StackNameByProject(maptDHDefaultPrefix), + BackedURL: maptContext.BackedURL(), + ProviderCredentials: aws.DefaultCredentials, + }) + if err != nil { + return nil, nil, err + } + outputs, err := manager.GetOutputs(s) + if err != nil { + return nil, nil, err + } + if value, exists := outputs[fmt.Sprintf("%s-%s", *prefix, outputRegion)]; exists { + regionV := value.Value.(string) + region = ®ionV + } + if value, exists := outputs[fmt.Sprintf("%s-%s", *prefix, outputDedicatedHostID)]; exists { + dhIdV := value.Value.(string) + hostId = &dhIdV + } + return +} + +// this function will create the dedicated host resource +func (r *dedicatedHostRequest) deploy(ctx *pulumi.Context) (err error) { + ctx.Export(fmt.Sprintf("%s-%s", *r.prefix, outputRegion), pulumi.String(*r.region)) + opts := maptContext.CommonOptions(ctx) + // Dedicated host will be created through sdk and then + // imported to be a pulumi managed resource + // also resource will be destroyed by pulumi + opts = append(opts, pulumi.Import(pulumi.ID(*r.hostId))) + dha := &ec2.DedicatedHostArgs{ + AutoPlacement: pulumi.String("off"), + AvailabilityZone: pulumi.String(*r.azId), + InstanceType: pulumi.String(*r.instanceType), + } + // tags need to be exactly the ones added to the dedicated host + if r.tags != nil { + dha.Tags = r.tagsAsStringMapInput() + } + dh, err := ec2.NewDedicatedHost(ctx, + resourcesUtil.GetResourceName(*r.prefix, awsDH, "dh"), + dha, opts...) + if err != nil { + return err + } + ctx.Export(fmt.Sprintf("%s-%s", *r.prefix, outputDedicatedHostID), + dh.ID()) + ctx.Export(fmt.Sprintf("%s-%s", *r.prefix, outputDedicatedHostAZ), + pulumi.String(*r.azId)) + return nil +} + +// results for dedicated host it will return dedicatedhost ID and dedicatedhost AZ +// also write results to files on the target folder +func manageResultsDedicatedHost( + stackResult auto.UpResult, prefix string, export bool) (*string, *string, error) { + if export { + if err := output.Write(stackResult, maptContext.GetResultsOutputPath(), map[string]string{ + fmt.Sprintf("%s-%s", prefix, outputDedicatedHostID): "dedicated_host_id", + }); err != nil { + return nil, nil, err + } + } + dhID, ok := stackResult.Outputs[fmt.Sprintf("%s-%s", prefix, outputDedicatedHostID)].Value.(string) + if !ok { + return nil, nil, fmt.Errorf("error getting dedicated host ID") + } + dhAZ, ok := stackResult.Outputs[fmt.Sprintf("%s-%s", prefix, outputDedicatedHostAZ)].Value.(string) + if !ok { + return nil, nil, fmt.Errorf("error getting dedicated host AZ") + } + return &dhID, &dhAZ, nil +} diff --git a/pkg/provider/aws/modules/iam/iam.go b/pkg/provider/aws/modules/iam/iam.go index e8f12b4ba..82af4e433 100644 --- a/pkg/provider/aws/modules/iam/iam.go +++ b/pkg/provider/aws/modules/iam/iam.go @@ -46,13 +46,20 @@ func InstanceProfile(ctx *pulumi.Context, prefix, id *string, policiesARNs []str } func (a *iamRequestArgs) deploy(ctx *pulumi.Context) error { + _, _, err := a.resources(ctx) + return err + +} + +func (a *iamRequestArgs) resources(ctx *pulumi.Context) (*iam.User, *iam.AccessKey, error) { user, err := iam.NewUser(ctx, resourcesUtil.GetResourceName(a.prefix, a.componentID, "user"), &iam.UserArgs{ Name: pulumi.String(a.name), - }) + }, + pulumi.DependsOn(a.dependsOn)) if err != nil { - return err + return nil, nil, err } _, err = iam.NewUserPolicy(ctx, resourcesUtil.GetResourceName(a.prefix, a.componentID, "policy"), @@ -61,7 +68,7 @@ func (a *iamRequestArgs) deploy(ctx *pulumi.Context) error { Policy: pulumi.String(*a.policyContent), }) if err != nil { - return err + return nil, nil, err } accessKey, err := iam.NewAccessKey( ctx, @@ -70,9 +77,9 @@ func (a *iamRequestArgs) deploy(ctx *pulumi.Context) error { User: user.Name, }) if err != nil { - return err + return nil, nil, err } ctx.Export(fmt.Sprintf("%s-%s", a.prefix, outputAccessKey), accessKey.ID()) ctx.Export(fmt.Sprintf("%s-%s", a.prefix, outputSecretKey), accessKey.Secret) - return nil + return user, accessKey, nil } diff --git a/pkg/provider/aws/modules/iam/stack.go b/pkg/provider/aws/modules/iam/stack.go index 35cae58d6..dd4229e88 100644 --- a/pkg/provider/aws/modules/iam/stack.go +++ b/pkg/provider/aws/modules/iam/stack.go @@ -7,18 +7,23 @@ import ( maptContext "github.com/redhat-developer/mapt/pkg/manager/context" "github.com/redhat-developer/mapt/pkg/provider/aws" "github.com/redhat-developer/mapt/pkg/provider/util/output" + "github.com/redhat-developer/mapt/pkg/util" "github.com/redhat-developer/mapt/pkg/util/logging" + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" "github.com/pulumi/pulumi/sdk/v3/go/auto" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) -func Create(accountName string, policyContent *string) error { +const defaultPrefix = "mapt" + +func Create(prefix, accountName string, policyContent *string) error { r := &iamRequestArgs{ name: accountName, policyContent: policyContent, - // Being isolated stack these values - // do not care - prefix: "mapt", + prefix: util.If(len(prefix) > 0, + prefix, + string(defaultPrefix)), componentID: "", } stack := manager.Stack{ @@ -32,7 +37,7 @@ func Create(accountName string, policyContent *string) error { if err != nil { return err } - return manageResultsMachine(sr, r.prefix) + return Results(sr, r.prefix) } func Destroy() (err error) { @@ -43,7 +48,20 @@ func Destroy() (err error) { }) } -func manageResultsMachine(stackResult auto.UpResult, prefix string) error { +func Deploy(ctx *pulumi.Context, prefix, accountName string, policyContent *string, dependsOn []pulumi.Resource) (*iam.User, *iam.AccessKey, error) { + r := &iamRequestArgs{ + name: accountName, + policyContent: policyContent, + prefix: util.If(len(prefix) > 0, + prefix, + string(defaultPrefix)), + componentID: "", + dependsOn: dependsOn, + } + return r.resources(ctx) +} + +func Results(stackResult auto.UpResult, prefix string) error { results := map[string]string{ fmt.Sprintf("%s-%s", prefix, outputAccessKey): "accessKey", fmt.Sprintf("%s-%s", prefix, outputSecretKey): "secretKey", diff --git a/pkg/provider/aws/modules/iam/types.go b/pkg/provider/aws/modules/iam/types.go index 363208d60..ef5985f8e 100644 --- a/pkg/provider/aws/modules/iam/types.go +++ b/pkg/provider/aws/modules/iam/types.go @@ -1,5 +1,7 @@ package iam +import "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + const ( stackName = "iam-manager" @@ -14,4 +16,6 @@ type iamRequestArgs struct { policyContent *string // optional params in case we create serverless inside a stack prefix, componentID string + // Dependecies + dependsOn []pulumi.Resource } diff --git a/pkg/provider/aws/modules/mac/constants/constants.go b/pkg/provider/aws/modules/mac/constants/constants.go new file mode 100644 index 000000000..09f8ba1fd --- /dev/null +++ b/pkg/provider/aws/modules/mac/constants/constants.go @@ -0,0 +1,12 @@ +package constants + +const ( + TagKeyPrefix = "prefix" + TagKeyBackedURL = "backedURL" + TagKeyArch = "arch" + TagKeyTicket = "ticket" + // tags added when dedicated host is part of a pool + TagKeyOSVersion = "osVersion" + TagKeyPoolName = "poolName" + TagKeyPoolOperationName = "poolOperation" +) diff --git a/pkg/provider/aws/modules/mac/host/host.go b/pkg/provider/aws/modules/mac/host/host.go index f82434fba..c24e58e31 100644 --- a/pkg/provider/aws/modules/mac/host/host.go +++ b/pkg/provider/aws/modules/mac/host/host.go @@ -1,49 +1,40 @@ package host import ( - "fmt" "maps" - "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" - "github.com/pulumi/pulumi/sdk/v3/go/auto" - "github.com/pulumi/pulumi/sdk/v3/go/pulumi" - "github.com/redhat-developer/mapt/pkg/manager" maptContext "github.com/redhat-developer/mapt/pkg/manager/context" - "github.com/redhat-developer/mapt/pkg/provider/aws" - awsConstants "github.com/redhat-developer/mapt/pkg/provider/aws/constants" "github.com/redhat-developer/mapt/pkg/provider/aws/data" + dedicatedhost "github.com/redhat-developer/mapt/pkg/provider/aws/modules/ec2/compute/dedicated-host" "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac" - "github.com/redhat-developer/mapt/pkg/provider/util/output" + macConstants "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/constants" "github.com/redhat-developer/mapt/pkg/util/logging" - resourcesUtil "github.com/redhat-developer/mapt/pkg/util/resources" + utilMaps "github.com/redhat-developer/mapt/pkg/util/maps" ) -// Idea move away from multi file creation a set outputs as an unified yaml file -// type macdh struct { -// ID string `yaml:"id"` -// AZ string `yaml:"az"` -// BackedURL string `yaml:"backedurl"` -// ProjectName string `yaml:"projectname"` -// } - func CreatePoolDedicatedHost(args *PoolMacDedicatedHostRequestArgs) (dhi *mac.HostInformation, err error) { tags := map[string]string{ - tagKeyBackedURL: args.BackedURL, - tagKeyPrefix: args.MacDedicatedHost.Prefix, - maptContext.TagKeyRunID: maptContext.RunID(), + macConstants.TagKeyBackedURL: args.BackedURL, + macConstants.TagKeyPrefix: args.MacDedicatedHost.Prefix, + maptContext.TagKeyRunID: maptContext.RunID(), } - maps.Copy(tags, args.PoolID.asTags()) + maps.Copy(tags, args.PoolID.AsTags()) return createDedicatedHost(args.MacDedicatedHost, args.BackedURL, tags, false) } +func DestroyPoolDedicatedHost(prefix *string) error { + return dedicatedhost.Destroy(prefix) +} + // this creates the stack for the dedicated host func CreateDedicatedHost(args *MacDedicatedHostRequestArgs) (dhi *mac.HostInformation, err error) { backedURL := getBackedURL() tags := map[string]string{ - tagKeyBackedURL: backedURL, - tagKeyPrefix: args.Prefix, - tagKeyArch: args.Architecture, - maptContext.TagKeyRunID: maptContext.RunID(), + macConstants.TagKeyBackedURL: backedURL, + macConstants.TagKeyPrefix: args.Prefix, + macConstants.TagKeyArch: args.Architecture, + maptContext.TagKeyRunID: maptContext.RunID(), + macConstants.TagKeyTicket: "", } return createDedicatedHost(args, backedURL, tags, true) } @@ -52,38 +43,23 @@ func createDedicatedHost(args *MacDedicatedHostRequestArgs, backedURL string, tags map[string]string, exportOutputs bool) (dhi *mac.HostInformation, err error) { - // mac does not offer spot, this will check region based on default region Env, - // if machine type is not offered on the region it will try to find a new region for it - dHArgs := dedicatedHostArgs{ - prefix: args.Prefix, - arch: args.Architecture, - tags: tags, - } - dHArgs.region, err = getRegion(args.Architecture, args.FixedLocation) - if err != nil { - return nil, err + dhTags := utilMaps.Append(maptContext.GetTags(), tags) + it := mac.TypesByArch[args.Architecture] + dHArgs := dedicatedhost.DedicatedHostArgs{ + Prefix: &args.Prefix, + InstanceType: &it, + Tags: dhTags, } - // pick random az from region ensuring machine is offered (sometimes machines are not offered on each az from a region) - dHArgs.availabilityZone, err = getAZ(*dHArgs.region, args.Architecture) + dHArgs.Region, err = getRegion(args.Architecture, true) if err != nil { return nil, err } - cs := manager.Stack{ - StackName: maptContext.StackNameByProject(mac.StackDedicatedHost), - ProjectName: maptContext.ProjectName(), - BackedURL: backedURL, - ProviderCredentials: aws.GetClouProviderCredentials( - map[string]string{ - awsConstants.CONFIG_AWS_REGION: *dHArgs.region}), - DeployFunc: dHArgs.deploy, - } - sr, _ := manager.UpStack(cs) - dhID, _, err := manageResultsDedicatedHost(sr, dHArgs.prefix, exportOutputs) + dh, err := dedicatedhost.Create(&backedURL, exportOutputs, &dHArgs) if err != nil { return nil, err } - logging.Debugf("mac dedicated host with host id %s has been created successfully", *dhID) - host, err := data.GetDedicatedHost(*dhID) + logging.Debugf("mac dedicated host with host id %s has been created successfully", *dh.HostId) + host, err := data.GetDedicatedHost(*dh.HostId) if err != nil { return nil, err } @@ -91,46 +67,3 @@ func createDedicatedHost(args *MacDedicatedHostRequestArgs, dhi = i return } - -// this function will create the dedicated host resource -func (r *dedicatedHostArgs) deploy(ctx *pulumi.Context) (err error) { - ctx.Export(fmt.Sprintf("%s-%s", r.prefix, outputRegion), pulumi.String(*r.region)) - dh, err := ec2.NewDedicatedHost(ctx, - resourcesUtil.GetResourceName(r.prefix, awsMacHostID, "dh"), - &ec2.DedicatedHostArgs{ - AutoPlacement: pulumi.String("off"), - AvailabilityZone: pulumi.String(*r.availabilityZone), - InstanceType: pulumi.String(mac.TypesByArch[r.arch]), - Tags: maptContext.ResourceTagsWithCustom(r.tags), - }) - ctx.Export(fmt.Sprintf("%s-%s", r.prefix, outputDedicatedHostID), - dh.ID()) - ctx.Export(fmt.Sprintf("%s-%s", r.prefix, outputDedicatedHostAZ), - pulumi.String(*r.availabilityZone)) - if err != nil { - return err - } - return nil -} - -// results for dedicated host it will return dedicatedhost ID and dedicatedhost AZ -// also write results to files on the target folder -func manageResultsDedicatedHost( - stackResult auto.UpResult, prefix string, export bool) (*string, *string, error) { - if export { - if err := output.Write(stackResult, maptContext.GetResultsOutputPath(), map[string]string{ - fmt.Sprintf("%s-%s", prefix, outputDedicatedHostID): "dedicated_host_id", - }); err != nil { - return nil, nil, err - } - } - dhID, ok := stackResult.Outputs[fmt.Sprintf("%s-%s", prefix, outputDedicatedHostID)].Value.(string) - if !ok { - return nil, nil, fmt.Errorf("error getting dedicated host ID") - } - dhAZ, ok := stackResult.Outputs[fmt.Sprintf("%s-%s", prefix, outputDedicatedHostAZ)].Value.(string) - if !ok { - return nil, nil, fmt.Errorf("error getting dedicated host AZ") - } - return &dhID, &dhAZ, nil -} diff --git a/pkg/provider/aws/modules/mac/host/types.go b/pkg/provider/aws/modules/mac/host/types.go index 0de3b7b05..879348ee6 100644 --- a/pkg/provider/aws/modules/mac/host/types.go +++ b/pkg/provider/aws/modules/mac/host/types.go @@ -1,27 +1,23 @@ package host -const ( - // mapt internal ID for the component: nac dedicated host - awsMacHostID = "amh" - - tagKeyPrefix = "prefix" - tagKeyBackedURL = "backedURL" - tagKeyArch = "arch" - // tags added when dedicated host is part of a pool - tagKeyOSVersion = "osVersion" - tagKeyPoolName = "poolName" - - outputDedicatedHostID = "ammDedicatedHostID" - outputDedicatedHostAZ = "ammDedicatedHostAZ" - outputRegion = "ammRegion" +import ( + macConstants "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/constants" ) type MacDedicatedHostRequestArgs struct { // Allow orquestrate Prefix string - Architecture string - FixedLocation bool + Architecture string + // Previously it supported check multi region for capacity due to pool approach + // for the time being this will be fixed + // FixedLocation bool + // House keeper requires extra info for setup network and security for managed machines + VPCID *string + Region *string + AZID *string + SubnetID *string + SSHSGID *string } type PoolID struct { @@ -30,11 +26,11 @@ type PoolID struct { OSVersion string } -func (p *PoolID) asTags() map[string]string { +func (p *PoolID) AsTags() map[string]string { return map[string]string{ - tagKeyArch: p.Arch, - tagKeyOSVersion: p.OSVersion, - tagKeyPoolName: p.PoolName, + macConstants.TagKeyArch: p.Arch, + macConstants.TagKeyOSVersion: p.OSVersion, + macConstants.TagKeyPoolName: p.PoolName, } } @@ -44,14 +40,6 @@ type PoolMacDedicatedHostRequestArgs struct { PoolID *PoolID } -type dedicatedHostArgs struct { - prefix string - arch string - region *string - availabilityZone *string - tags map[string]string -} - var ( awsArchIDbyArch = map[string]string{ "x86": "x86_64_mac", diff --git a/pkg/provider/aws/modules/mac/host/util.go b/pkg/provider/aws/modules/mac/host/util.go index dfa272d8a..15619a55f 100644 --- a/pkg/provider/aws/modules/mac/host/util.go +++ b/pkg/provider/aws/modules/mac/host/util.go @@ -10,6 +10,7 @@ import ( maptContext "github.com/redhat-developer/mapt/pkg/manager/context" "github.com/redhat-developer/mapt/pkg/provider/aws/data" "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac" + macConstants "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/constants" "github.com/redhat-developer/mapt/pkg/util/logging" "golang.org/x/exp/slices" ) @@ -18,14 +19,14 @@ import ( // it will return the list ordered by allocation time func GetMatchingHostsInformation(arch string) ([]*mac.HostInformation, error) { matchingTags := maptContext.GetTags() - matchingTags[tagKeyArch] = arch + matchingTags[macConstants.TagKeyArch] = arch return GetMatchingHostsInStateInformation(matchingTags, nil) } // Get all dedicated hosts matching the tags + arch // it will return the list ordered by allocation time func GetPoolDedicatedHostsInformation(id *PoolID) ([]*mac.HostInformation, error) { - return GetMatchingHostsInStateInformation(id.asTags(), nil) + return GetMatchingHostsInStateInformation(id.AsTags(), nil) } // Get all dedicated hosts in available state ordered based on the allocation time @@ -54,7 +55,7 @@ func GetMatchingHostsInStateInformation(matchingTags map[string]string, state *e } var r []*mac.HostInformation for _, dh := range hosts { - if state == nil || (state != nil && dh.State == *state) { + if state == nil || dh.State == *state { r = append(r, GetHostInformation(dh)) } } @@ -72,16 +73,18 @@ func GetMatchingHostsInStateInformation(matchingTags map[string]string, state *e func GetHostInformation(h ec2Types.Host) *mac.HostInformation { az := *h.AvailabilityZone region := az[:len(az)-1] - archValue := awsArchIDbyArch[*getTagValue(h.Tags, tagKeyArch)] + archValue := awsArchIDbyArch[*getTagValue(h.Tags, macConstants.TagKeyArch)] return &mac.HostInformation{ Arch: &archValue, - OSVersion: getTagValue(h.Tags, tagKeyOSVersion), - BackedURL: getTagValue(h.Tags, tagKeyBackedURL), - Prefix: getTagValue(h.Tags, tagKeyPrefix), + OSVersion: getTagValue(h.Tags, macConstants.TagKeyOSVersion), + BackedURL: getTagValue(h.Tags, macConstants.TagKeyBackedURL), + Prefix: getTagValue(h.Tags, macConstants.TagKeyPrefix), ProjectName: getTagValue(h.Tags, maptContext.TagKeyProjectName), RunID: getTagValue(h.Tags, maptContext.TagKeyRunID), Region: ®ion, Host: &h, + AzId: &az, + PoolName: getTagValue(h.Tags, macConstants.TagKeyPoolName), } } @@ -124,25 +127,3 @@ func getRegion(arch string, fixedLocation bool) (*string, error) { return data.LokupRegionOfferingInstanceType( mac.TypesByArch[arch]) } - -// Get a random AZ from the requested region, it ensures the az offers the instance type -func getAZ(region, arch string) (az *string, err error) { - isOffered := false - var excludedAZs []string - for !isOffered { - az, err = data.GetRandomAvailabilityZone(region, excludedAZs) - if err != nil { - return nil, err - } - isOffered, err = data.IsInstanceTypeOfferedByAZ( - region, - mac.TypesByArch[arch], *az) - if err != nil { - return nil, err - } - if !isOffered { - excludedAZs = append(excludedAZs, *az) - } - } - return -} diff --git a/pkg/provider/aws/modules/mac/machine/machine.go b/pkg/provider/aws/modules/mac/machine/machine.go index 98928d41e..b3514a359 100644 --- a/pkg/provider/aws/modules/mac/machine/machine.go +++ b/pkg/provider/aws/modules/mac/machine/machine.go @@ -180,17 +180,33 @@ func (r *Request) deployerMachine(ctx *pulumi.Context) error { if err != nil { return err } - nr := network.NetworkRequest{ - Prefix: r.Prefix, - ID: awsMacMachineID, - Region: *r.Region, - AZ: *r.AvailabilityZone, - Airgap: r.Airgap, - AirgapPhaseConnectivity: r.airgapPhaseConnectivity, - } - vpc, targetSubnet, targetRouteTableAssociation, bastion, _, _, err := nr.Network(ctx) - if err != nil { - return err + // Networks + var vpc *ec2.Vpc + var targetSubnet *ec2.Subnet + var targetRouteTableAssociation *ec2.RouteTableAssociation + var bastion *bastion.Bastion + if r.VPCID == nil { + nr := network.NetworkRequest{ + Prefix: r.Prefix, + ID: awsMacMachineID, + Region: *r.Region, + AZ: *r.AvailabilityZone, + Airgap: r.Airgap, + AirgapPhaseConnectivity: r.airgapPhaseConnectivity, + } + vpc, targetSubnet, targetRouteTableAssociation, bastion, _, _, err = nr.Network(ctx) + if err != nil { + return err + } + } else { + r.subnetID, err = data.GetSubnetID(&data.SubnetRequestArgs{ + Region: r.Region, + VpcId: r.VPCID, + AzId: r.AvailabilityZone, + }) + if err != nil { + return err + } } // Create Keypair machineKeyPair := keypair.KeyPairRequest{ @@ -245,6 +261,7 @@ func (r *Request) deployerMachine(ctx *pulumi.Context) error { // We offer serverless release so there should be a timeout and operation should be a request if len(r.Timeout) > 0 && r.isRequestOperation { if err = serverless.OneTimeDelayedTask(ctx, + fmt.Sprintf("mac-pool-release-%s", maptContext.RunID()), *r.Region, r.Prefix, awsMacMachineID, fmt.Sprintf("aws mac-pool release --dedicated-host-id %s --serverless", *r.dedicatedHost.Host.HostId), @@ -283,7 +300,12 @@ func (r *Request) securityGroups(ctx *pulumi.Context, vpc *ec2.Vpc) (pulumi.StringArray, error) { // ingress for ssh access from 0.0.0.0 sshIngressRule := securityGroup.SSH_TCP - sshIngressRule.CidrBlocks = infra.NETWORKING_CIDR_ANY_IPV4 + // TODO we should decide if we only allow machines management based on pool + if r.SSHSGID != nil { + sshIngressRule.SGID = r.SSHSGID + } else { + sshIngressRule.CidrBlocks = infra.NETWORKING_CIDR_ANY_IPV4 + } // ingress for vnc access from 0.0.0.0 vncIngressRule := securityGroup.IngressRules{ Description: fmt.Sprintf("VNC port for %s", awsMacMachineID), @@ -310,12 +332,17 @@ func (r *Request) securityGroups(ctx *pulumi.Context, }) } // Create SG with ingress rules - sg, err := securityGroup.SGRequest{ + sgr := securityGroup.SGRequest{ Name: resourcesUtil.GetResourceName(r.Prefix, awsMacMachineID, "sg"), - VPC: vpc, Description: fmt.Sprintf("sg for %s", awsMacMachineID), IngressRules: ingressRules, - }.Create(ctx) + } + if r.VPCID != nil { + sgr.VPCID = r.VPCID + } else { + sgr.VPC = vpc + } + sg, err := sgr.Create(ctx) if err != nil { return nil, err } @@ -336,7 +363,6 @@ func (r *Request) instance(ctx *pulumi.Context, ) (*ec2.Instance, error) { instanceArgs := ec2.InstanceArgs{ HostId: pulumi.String(*r.dedicatedHost.Host.HostId), - SubnetId: subnet.ID(), Ami: pulumi.String(*ami.Image.ImageId), InstanceType: pulumi.String(mac.TypesByArch[r.Architecture]), KeyName: keyResources.AWSKeyPair.KeyName, @@ -347,18 +373,26 @@ func (r *Request) instance(ctx *pulumi.Context, }, Tags: maptContext.ResourceTags(), } + if subnet != nil { + instanceArgs.SubnetId = subnet.ID() + } else { + instanceArgs.SubnetId = pulumi.String(*r.subnetID) + } if r.Airgap { instanceArgs.AssociatePublicIpAddress = pulumi.Bool(false) } + // Options + opts := maptContext.CommonOptions(ctx) + // Retain on delete to speed destroy operation for the dedicated host, + // destroy is managed by replace root volume operation + // pulumi.RetainOnDelete(true), + // All changes on the instance should be done through root volume replace + // as so we ignore Amis missmatch + opts = append(opts, pulumi.IgnoreChanges([]string{"ami"})) return ec2.NewInstance(ctx, resourcesUtil.GetResourceName(r.Prefix, awsMacMachineID, "instance"), &instanceArgs, - // Retain on delete to speed destroy operation for the dedicated host, - // destroy is managed by replace root volume operation - // pulumi.RetainOnDelete(true), - // All changes on the instance should be done through root volume replace - // as so we ignore Amis missmatch - pulumi.IgnoreChanges([]string{"ami"})) + opts...) } func (r *Request) bootstrapscript(ctx *pulumi.Context, diff --git a/pkg/provider/aws/modules/mac/machine/types.go b/pkg/provider/aws/modules/mac/machine/types.go index fd81e6e99..d096a905c 100644 --- a/pkg/provider/aws/modules/mac/machine/types.go +++ b/pkg/provider/aws/modules/mac/machine/types.go @@ -17,6 +17,11 @@ type Request struct { Airgap bool // If timeout is set a severless scheduled task will be created to self destroy the resources Timeout string + // Network and Security + VPCID *string + SSHSGID *string + + subnetID *string // For airgap scenario there is an orchestation of // a phase with connectivity on the machine (allowing bootstraping) // a pahase with connectivyt off where the subnet for the target lost the nat gateway diff --git a/pkg/provider/aws/modules/mac/pool/client.go b/pkg/provider/aws/modules/mac/pool/client.go new file mode 100644 index 000000000..18dbfd412 --- /dev/null +++ b/pkg/provider/aws/modules/mac/pool/client.go @@ -0,0 +1,73 @@ +package pool + +import ( + "encoding/json" + "fmt" + + awsIAM "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/redhat-developer/mapt/pkg/provider/aws/modules/iam" +) + +// Create an user and a pair of automation credentials to add on cicd system of choice +// to execute request and release operation with minimum rights +func clientAccount(ctx *pulumi.Context, name, arch, osVersion string, dependsOn []pulumi.Resource) (*awsIAM.User, *awsIAM.AccessKey, error) { + pc, err := clientPolicy() + if err != nil { + return nil, nil, err + } + return iam.Deploy(ctx, + name, + fmt.Sprintf("%s-%s-%s", name, arch, osVersion), + pc, dependsOn) +} + +// This is only used during create to create a policy content allowing to +// run request and release operations. Helping to reduce the iam rights required +// to make use for the mac pool service from an user point of view +func clientPolicy() (*string, error) { + pc, err := json.Marshal(map[string]interface{}{ + "Version": "2012-10-17", + "Statement": []map[string]interface{}{ + { + "Effect": "Allow", + "Action": []string{ + "ecs:RunTask", + "ecs:DescribeTasks", + "ecs:DescribeTaskDefinition", + "ecs:ListTaskDefinitions", + "tag:GetResources", + }, + "Resource": []string{ + "*", + }, + }, + { + "Effect": "Allow", + "Action": []string{ + "iam:PassRole", + }, + "Resource": []string{ + "*", + }, + }, + { + "Effect": "Allow", + "Action": []string{ + "ec2:DescribeSubnets", + "ec2:DescribeSecurityGroups", + "ec2:DescribeVpcs", + "ec2:DescribeRouteTables", + }, + "Resource": []string{ + "*", + }, + }, + }, + }) + if err != nil { + return nil, err + } + policy := string(pc) + return &policy, nil +} diff --git a/pkg/provider/aws/modules/mac/pool/pool.go b/pkg/provider/aws/modules/mac/pool/pool.go new file mode 100644 index 000000000..d66e15e68 --- /dev/null +++ b/pkg/provider/aws/modules/mac/pool/pool.go @@ -0,0 +1,142 @@ +package pool + +import ( + "fmt" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" + awsxecs "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/ecs" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/redhat-developer/mapt/pkg/provider/aws/data" + "github.com/redhat-developer/mapt/pkg/util" + + network "github.com/redhat-developer/mapt/pkg/provider/aws/modules/network/standard" + // "github.com/redhat-developer/mapt/pkg/provider/aws/modules/network" + securityGroup "github.com/redhat-developer/mapt/pkg/provider/aws/services/ec2/security-group" + "github.com/redhat-developer/mapt/pkg/provider/aws/services/vpc/subnet" + resourcesUtil "github.com/redhat-developer/mapt/pkg/util/resources" +) + +const ( + customResourceTypePool = "rh:rd:mapt:aws:mac:pool" + awsMacPoolID = "amp" +) + +type PoolArgs struct { + Region string + Name string + Arch string + OSVersion string + OfferedCapacity int + MaxSize int +} + +type Pool struct { + pulumi.ResourceState + + Region pulumi.StringOutput `pulumi:"region"` + + Name pulumi.StringOutput `pulumi:"name"` + Arch pulumi.StringOutput `pulumi:"arch"` + OSVersion pulumi.StringOutput `pulumi:"osVersion"` + OfferedCapacity pulumi.IntOutput `pulumi:"offeredCapacity"` + MaxSize pulumi.IntOutput `pulumi:"maxSize"` + + Vpc ec2.VpcOutput `pulumi:"vpc"` + Subnets []ec2.SubnetOutput `pulumi:"subnets"` + SshSG ec2.SecurityGroupOutput `pulumi:"sshSG"` + + TaskHouseKeep awsxecs.FargateTaskDefinitionOutput `pulumi:"taskHouseKeep"` + TaskRequest awsxecs.FargateTaskDefinitionOutput `pulumi:"taskRequest"` + TaskRelease awsxecs.FargateTaskDefinitionOutput `pulumi:"taskRelease"` + + ClientAK pulumi.StringOutput `pulumi:"clientAK"` + ClientSK pulumi.StringOutput `pulumi:"clientSK"` +} + +func NewPool(ctx *pulumi.Context, name string, p *PoolArgs, opts ...pulumi.ResourceOption) (*Pool, error) { + var err error + res := &Pool{ + Region: pulumi.String(p.Region).ToStringOutput(), + Name: pulumi.String(p.Name).ToStringOutput(), + Arch: pulumi.String(p.Arch).ToStringOutput(), + OSVersion: pulumi.String(p.OSVersion).ToStringOutput(), + OfferedCapacity: pulumi.Int(p.OfferedCapacity).ToIntOutput(), + MaxSize: pulumi.Int(p.MaxSize).ToIntOutput(), + } + if err = ctx.RegisterComponentResource( + customResourceTypePool, + name, + res, + opts...); err != nil { + return nil, err + } + azs := data.GetAvailabilityZones(p.Region) + nr, err := network.NetworkRequest{ + Name: p.Name, + Region: p.Region, + AvailabilityZones: azs, + CIDR: network.DefaultCIDRNetwork, + PublicSubnetsCIDRs: network.DefaultCIDRPublicSubnets[:len(azs)], + NatGatewayType: network.NONE, + }.CreateNetwork(ctx) + if err != nil { + return nil, err + } + sshRunnerSG, err := securityGroup.SGRequest{ + Name: resourcesUtil.GetResourceName(p.Name, awsMacPoolID, "ssh-runner-sg"), + VPC: nr.VPCResources.VPC, + Description: fmt.Sprintf("sg for %s", awsMacPoolID), + }.Create(ctx) + if err != nil { + return nil, err + } + // Outputs + res.Vpc = nr.VPCResources.VPC.ToVpcOutput() + res.Subnets = util.ArrayConvert(nr.PublicSNResources, + func(sn *subnet.PublicSubnetResources) ec2.SubnetOutput { + return sn.Subnet.ToSubnetOutput() + }) + res.SshSG = sshRunnerSG.SG.ToSecurityGroupOutput() + // Tasks + res.TaskHouseKeep = pulumi.All(nr.VPCResources.VPC.ID(), nr.PublicSNResources[0].Subnet.ID(), sshRunnerSG.SG.ID()).ApplyT( + func(args []any) (*awsxecs.FargateTaskDefinition, error) { + vpcID := string(args[0].(pulumi.ID)) + subnetID := string(args[1].(pulumi.ID)) + sgID := string(args[2].(pulumi.ID)) + return houseKeeperTaskSpecScheduler(ctx, p, &vpcID, &subnetID, &sgID) + }).(awsxecs.FargateTaskDefinitionOutput) + res.TaskRequest = pulumi.All(nr.VPCResources.VPC.ID(), nr.PublicSNResources[0].Subnet.ID(), sshRunnerSG.SG.ID()).ApplyT( + func(args []any) (*awsxecs.FargateTaskDefinition, error) { + vpcID := string(args[0].(pulumi.ID)) + subnetID := string(args[1].(pulumi.ID)) + sgID := string(args[2].(pulumi.ID)) + return requestTaskSpec(ctx, p, &vpcID, &subnetID, &sgID) + }).(awsxecs.FargateTaskDefinitionOutput) + res.TaskRelease = pulumi.All(nr.VPCResources.VPC.ID(), nr.PublicSNResources[0].Subnet.ID(), sshRunnerSG.SG.ID()).ApplyT( + func(args []any) (*awsxecs.FargateTaskDefinition, error) { + vpcID := string(args[0].(pulumi.ID)) + subnetID := string(args[1].(pulumi.ID)) + sgID := string(args[2].(pulumi.ID)) + return releaseTaskSpec(ctx, p, &vpcID, &subnetID, &sgID) + }).(awsxecs.FargateTaskDefinitionOutput) + + _, ak, err := clientAccount(ctx, p.Name, p.Arch, p.OSVersion, nil) + if err != nil { + return nil, err + } + return res, ctx.RegisterResourceOutputs(res, pulumi.Map{ + "region": res.Region, + "name": res.Name, + "arch": res.Arch, + "osVersion": res.OSVersion, + "offeredCapacity": res.OfferedCapacity, + "maxSize": res.MaxSize, + "vpc": res.Vpc, + "sshSG": res.SshSG, + "taskHouseKeep": res.TaskHouseKeep, + "taskRequest": res.TaskRequest, + "taskRelease": res.TaskRelease, + "clientAK": ak.ID(), + "clientSK": ak.Secret, + }) +} diff --git a/pkg/provider/aws/modules/mac/pool/task-housekeep.go b/pkg/provider/aws/modules/mac/pool/task-housekeep.go new file mode 100644 index 000000000..e033ffd4e --- /dev/null +++ b/pkg/provider/aws/modules/mac/pool/task-housekeep.go @@ -0,0 +1,76 @@ +package pool + +import ( + "fmt" + + awsxecs "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/ecs" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + maptContext "github.com/redhat-developer/mapt/pkg/manager/context" + "github.com/redhat-developer/mapt/pkg/provider/aws/modules/serverless" +) + +// func houseKeeperRemote(tARN *string, +// name, arch, osVersion *string, +// offeredCapacity, maxSize *int, +// vpcID, sshSGID *string) error { +// // How to handle the region...coming from create operation we are always using "us-east-1" +// region := "us-east-1" +// command := houseKeepCommand(*name, *arch, *osVersion, +// *offeredCapacity, *maxSize, +// vpcID, sshSGID) +// containerName := houseKeepContainerName(*name, *arch, *osVersion) +// subnetID, err := data.GetSubnetID(&data.SubnetRequestArgs{ +// Region: ®ion, +// VpcId: vpcID}) +// if err != nil { +// return err +// } +// return ecs.RunTaskWithCommand(®ion, tARN, &serverless.MaptServerlessClusterName, +// &containerName, &command, +// subnetID, sshSGID) +// } + +func houseKeeperTaskSpecScheduler(ctx *pulumi.Context, p *PoolArgs, + vpcID, subnetID, sgID *string) (*awsxecs.FargateTaskDefinition, error) { + cn := houseKeepContainerName( + p.Name, + p.Arch, + p.OSVersion) + return serverless.Deploy(ctx, + &serverless.ServerlessArgs{ + Prefix: operationHouseKeep, + Region: p.Region, + ContainerName: cn, + Command: houseKeepCommand( + p.Name, p.Arch, p.OSVersion, + p.OfferedCapacity, p.MaxSize, + vpcID, sgID), + ScheduleType: &serverless.Repeat, + Schedulexpression: scheduleIntervalHouseKeep, + LogGroupName: cn, + // These values are required to setup the scheduler as the container + // running the task should be executed within same subnet and with sshsgid + // in order to ssh into mac machine + ExecutionDefaults: map[string]*string{ + serverless.TaskExecDefaultVPCID: vpcID, + serverless.TaskExecDefaultSubnetID: subnetID, + serverless.TaskExecDefaultSGID: sgID, + }}) +} + +func houseKeepContainerName(name, arch, osVersion string) string { + return fmt.Sprintf("housekeeper-%s-%s-%s", + name, + arch, + osVersion) +} + +func houseKeepCommand(poolName, arch, osVersion string, + offeredCapacity, maxSize int, vpcID, sshSGID *string) string { + cmd := fmt.Sprintf(cmdRegexHouseKeep, + poolName, arch, osVersion, + offeredCapacity, maxSize, + *vpcID, *sshSGID, + maptContext.ProjectName(), maptContext.BackedURL()) + return cmd +} diff --git a/pkg/provider/aws/modules/mac/pool/task-release.go b/pkg/provider/aws/modules/mac/pool/task-release.go new file mode 100644 index 000000000..aa558277e --- /dev/null +++ b/pkg/provider/aws/modules/mac/pool/task-release.go @@ -0,0 +1,79 @@ +package pool + +import ( + awsxecs "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/ecs" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + maptContext "github.com/redhat-developer/mapt/pkg/manager/context" + "github.com/redhat-developer/mapt/pkg/provider/aws" + "github.com/redhat-developer/mapt/pkg/provider/aws/data" + macConstants "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/constants" + macHost "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/host" + "github.com/redhat-developer/mapt/pkg/provider/aws/modules/serverless" + "github.com/redhat-developer/mapt/pkg/provider/aws/services/ecs" + "github.com/redhat-developer/mapt/pkg/util/logging" +) + +func ReleaseRemote(ctx *maptContext.ContextArgs, ticket string) error { + if err := maptContext.Init(ctx, aws.Provider()); err != nil { + return err + } + // Get host as context will be fullfilled with info coming from the tags on the host + host, err := data.GetDedicatedHostByTag(map[string]string{macConstants.TagKeyTicket: ticket}) + if err != nil { + return err + } + hi := macHost.GetHostInformation(*host) + tARN, err := serverlessTaskARN( + *hi.PoolName, + *hi.Arch, + *hi.OSVersion, + operationRelease) + if err != nil { + return err + } + logging.Debugf("Got ARN for task spec %s", *tARN) + // How to handle the region...coming from create operation we are always using "us-east-1" + region := "us-east-1" + vpcID, sshSGID, err := getExecutionDefaultsFromTask(®ion, tARN) + if err != nil { + return err + } + command := commandToTask(vpcID, sshSGID) + containerName := releaseTaskContainerName(*hi.PoolName, *hi.Arch, *hi.OSVersion) + subnetID, err := data.GetSubnetID(&data.SubnetRequestArgs{ + Region: ®ion, + VpcId: vpcID}) + if err != nil { + return err + } + return ecs.RunTaskWithCommand(®ion, tARN, &serverless.MaptServerlessClusterName, + &containerName, &command, + subnetID, sshSGID) +} + +func releaseTaskSpec(ctx *pulumi.Context, p *PoolArgs, + vpcID, subnetID, sgID *string) (*awsxecs.FargateTaskDefinition, error) { + cn := releaseTaskContainerName(p.Name, p.Arch, p.OSVersion) + return serverless.Deploy( + ctx, + &serverless.ServerlessArgs{ + Prefix: operationRelease, + Region: p.Region, + ContainerName: cn, + Command: cmdRelease, + LogGroupName: cn, + ExecutionDefaults: map[string]*string{ + serverless.TaskExecDefaultVPCID: vpcID, + serverless.TaskExecDefaultSubnetID: subnetID, + serverless.TaskExecDefaultSGID: sgID, + }, + Tags: serverlessTags( + p.Name, + p.Arch, + p.OSVersion, + operationRelease)}) +} + +func releaseTaskContainerName(poolName, arch, osVersion string) string { + return serverlessName(poolName, arch, osVersion, operationRelease) +} diff --git a/pkg/provider/aws/modules/mac/pool/task-request.go b/pkg/provider/aws/modules/mac/pool/task-request.go new file mode 100644 index 000000000..90b721a97 --- /dev/null +++ b/pkg/provider/aws/modules/mac/pool/task-request.go @@ -0,0 +1,90 @@ +package pool + +import ( + "fmt" + + awsxecs "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/ecs" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + maptContext "github.com/redhat-developer/mapt/pkg/manager/context" + "github.com/redhat-developer/mapt/pkg/provider/aws" + "github.com/redhat-developer/mapt/pkg/provider/aws/data" + "github.com/redhat-developer/mapt/pkg/provider/aws/modules/serverless" + "github.com/redhat-developer/mapt/pkg/provider/aws/services/ecs" + "github.com/redhat-developer/mapt/pkg/util/logging" +) + +func RequestRemote(ctx *maptContext.ContextArgs, name, arch, osVersion, ticket *string) error { + if err := maptContext.Init(ctx, aws.Provider()); err != nil { + return err + } + tARN, err := serverlessTaskARN(*name, *arch, *osVersion, operationRequest) + if err != nil { + return err + } + logging.Debugf("Got ARN for task spec %s", *tARN) + // How to handle the region...coming from create operation we are always using "us-east-1" + region := "us-east-1" + vpcID, sshSGID, err := getExecutionDefaultsFromTask(®ion, tARN) + if err != nil { + return err + } + command := requestCommandTotask(vpcID, sshSGID, ticket) + containerName := requestTaskContainerName(*name, *arch, *osVersion) + subnetID, err := data.GetSubnetID(&data.SubnetRequestArgs{ + Region: ®ion, + VpcId: vpcID}) + if err != nil { + return err + } + // Run task serverless + return ecs.RunTaskWithCommand(®ion, tARN, &serverless.MaptServerlessClusterName, + &containerName, &command, + subnetID, sshSGID) +} + +func requestCommandTotask(vpcID, sshSGID, ticket *string) string { + command := commandToTask(vpcID, sshSGID) + return fmt.Sprintf("%s %s %s", command, paramTicket, *ticket) + +} + +// Run serverless operation request +// check how we will call it from the request? +// may add tags and find or add arn to stack? +func requestTaskSpec(ctx *pulumi.Context, p *PoolArgs, + vpcID, subnetID, sgID *string) (*awsxecs.FargateTaskDefinition, error) { + name := requestTaskContainerName( + p.Name, + p.Arch, + p.OSVersion) + return serverless.Deploy(ctx, + &serverless.ServerlessArgs{ + Prefix: operationRequest, + Region: p.Region, + ContainerName: name, + Command: requestCommand( + p.Name, + p.Arch, + p.OSVersion), + LogGroupName: name, + ExecutionDefaults: map[string]*string{ + serverless.TaskExecDefaultVPCID: vpcID, + serverless.TaskExecDefaultSubnetID: subnetID, + serverless.TaskExecDefaultSGID: sgID, + }, + Tags: serverlessTags( + p.Name, + p.Arch, + p.OSVersion, + operationRequest)}) +} + +func requestCommand(poolName, arch, osVersion string) string { + cmd := fmt.Sprintf(cmdRegexRequest, + poolName, arch, osVersion) + return cmd +} + +func requestTaskContainerName(poolName, arch, osVersion string) string { + return serverlessName(poolName, arch, osVersion, operationRequest) +} diff --git a/pkg/provider/aws/modules/mac/pool/task.go b/pkg/provider/aws/modules/mac/pool/task.go new file mode 100644 index 000000000..c8fa98098 --- /dev/null +++ b/pkg/provider/aws/modules/mac/pool/task.go @@ -0,0 +1,92 @@ +package pool + +import ( + "fmt" + "os" + "strings" + + "github.com/redhat-developer/mapt/pkg/provider/aws/data" + macConstants "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/constants" + macHost "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/host" + "github.com/redhat-developer/mapt/pkg/provider/aws/modules/serverless" + "github.com/redhat-developer/mapt/pkg/provider/aws/services/ecs" +) + +// Operations are based on mapt params around mac-pool +var ( + operationHouseKeep = "mac-pool-housekeep" + cmdRegexHouseKeep = "aws mac-pool house-keep --name %s --arch %s --version %s --offered-capacity %d --max-size %d --vpcid %s --ssh-sgid %s --project-name %s --backed-url %s --serverless" + // https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html#eb-rate-expressions + scheduleIntervalHouseKeep = "27 minutes" + + operationRequest = "mac-pool-request" + cmdRegexRequest = "aws mac-pool request --name %s --arch %s --version %s --serverless " + + operationRelease = "mac-pool-release" + cmdRelease = "aws mac-pool release --serverless " + + remoteCommandParamsRegex = "--vpcid %s --ssh-sgid %s --serverless " + paramTicket = "--ticket" +) + +// this is a business identificator to assing to resources related to the serverless management +func serverlessName(poolName, arch, osVersion, operation string) string { + return fmt.Sprintf("%s-%s-%s-%s", + operation, + poolName, + arch, + osVersion) +} + +// Return the map of tags wich should identify unique +// resquest operation spec for a pool +func serverlessTags(poolName, arch, osVersion, operation string) (m map[string]string) { + poolID := macHost.PoolID{ + PoolName: poolName, + Arch: arch, + OSVersion: osVersion, + } + m = poolID.AsTags() + m[macConstants.TagKeyPoolOperationName] = operation + return +} + +func serverlessTaskARN(poolName, arch, osVersion, operation string) (*string, error) { + rARNs, err := data.GetResourcesMatchingTags( + data.ResourceTypeECS, + serverlessTags( + poolName, + arch, + osVersion, + operation)) + if err != nil { + return nil, err + } + arn, err := data.ActiveTasks(rARNs) + if err != nil { + return nil, err + } + return arn, nil + +} + +// Command to be executed within the task is same as remote command without --remote flag +// and with specific network and security data (coming from task def as tags) +func commandToTask(vpcID, sshSGID *string) string { + rawCmd := strings.Join(os.Args[1:], " ") + cmd := strings.Replace(rawCmd, "--remote ", "", 1) + remoteParams := fmt.Sprintf(remoteCommandParamsRegex, + vpcID, sshSGID) + return fmt.Sprintf("%s %s", cmd, remoteParams) +} + +func getExecutionDefaultsFromTask(region *string, taskDefArn *string) (vpcID, sshSGID *string, err error) { + var tags map[string]*string + tags, err = ecs.GetTags(region, taskDefArn) + if err != nil { + return + } + vpcID = tags[serverless.TaskExecDefaultVPCID] + sshSGID = tags[serverless.TaskExecDefaultSGID] + return +} diff --git a/pkg/provider/aws/modules/mac/types.go b/pkg/provider/aws/modules/mac/types.go index b787d5223..ea8126b95 100644 --- a/pkg/provider/aws/modules/mac/types.go +++ b/pkg/provider/aws/modules/mac/types.go @@ -17,7 +17,16 @@ type HostInformation struct { ProjectName *string RunID *string Region *string + AzId *string Host *ec2Types.Host + // Optional in case the host belongs + // to a pool + PoolName *string + // Network and Security + // Network and Security + VPCID *string + SubnetID *string + SGSSHID *string } var ( diff --git a/pkg/provider/aws/modules/mac/util/util.go b/pkg/provider/aws/modules/mac/util/util.go index d8a6e178f..17c145df2 100644 --- a/pkg/provider/aws/modules/mac/util/util.go +++ b/pkg/provider/aws/modules/mac/util/util.go @@ -11,6 +11,7 @@ import ( awsConstants "github.com/redhat-developer/mapt/pkg/provider/aws/constants" "github.com/redhat-developer/mapt/pkg/provider/aws/data" "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac" + macConstants "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/constants" macHost "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/host" macMachine "github.com/redhat-developer/mapt/pkg/provider/aws/modules/mac/machine" "github.com/redhat-developer/mapt/pkg/util/logging" @@ -73,9 +74,9 @@ func IsMachineLocked(h *mac.HostInformation) (bool, error) { // get projectName (tag on the dh) // load machine stack based on those params // run release update on it -func Release(ctx *maptContext.ContextArgs, hostID string) error { +func Release(ctx *maptContext.ContextArgs, ticket string) error { // Get host as context will be fullfilled with info coming from the tags on the host - host, err := data.GetDedicatedHost(hostID) + host, err := data.GetDedicatedHostByTag(map[string]string{macConstants.TagKeyTicket: ticket}) if err != nil { return err } diff --git a/pkg/provider/aws/modules/network/network.go b/pkg/provider/aws/modules/network/network.go index fe9c6a9e4..4bad6a56f 100644 --- a/pkg/provider/aws/modules/network/network.go +++ b/pkg/provider/aws/modules/network/network.go @@ -81,7 +81,7 @@ func (r *NetworkRequest) manageNetworking(ctx *pulumi.Context) (*ec2.Vpc, *ec2.S Region: r.Region, AvailabilityZones: []string{r.AZ}, PublicSubnetsCIDRs: []string{cidrPublicSN}, - SingleNatGateway: true, + NatGatewayType: ns.SINGLE, }.CreateNetwork(ctx) if err != nil { return nil, nil, err diff --git a/pkg/provider/aws/modules/network/standard/stack.go b/pkg/provider/aws/modules/network/standard/stack.go index 31eacdd5e..6a68923b7 100644 --- a/pkg/provider/aws/modules/network/standard/stack.go +++ b/pkg/provider/aws/modules/network/standard/stack.go @@ -20,7 +20,7 @@ func Create(projectName, backedURL, cidr string, PublicSubnetsCIDRs: publicSubnets, PrivateSubnetsCIDRs: privateSubnets, IntraSubnetsCIDRs: intraSubnets, - SingleNatGateway: false} + NatGatewayType: ALL} stack := manager.Stack{ StackName: StackCreateNetworkName, ProjectName: projectName, diff --git a/pkg/provider/aws/modules/network/standard/standard.go b/pkg/provider/aws/modules/network/standard/standard.go index 3e754da8b..e94b2505e 100644 --- a/pkg/provider/aws/modules/network/standard/standard.go +++ b/pkg/provider/aws/modules/network/standard/standard.go @@ -18,19 +18,31 @@ const ( var ( DefaultCIDRNetwork string = "10.0.0.0/16" - DefaultCIDRPublicSubnets [3]string = [3]string{ - "10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"} - DefaultLBIPs [3]string = [3]string{ - "10.0.1.15", "10.0.2.15", "10.0.3.15"} - DefaultCIDRPrivateSubnets [3]string = [3]string{ - "10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"} - DefaultCIDRIntraSubnets [3]string = [3]string{ - "10.0.201.0/24", "10.0.202.0/24", "10.0.203.0/24"} + DefaultCIDRPublicSubnets [6]string = [6]string{ + "10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24", + "10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"} + DefaultLBIPs [6]string = [6]string{ + "10.0.1.15", "10.0.2.15", "10.0.3.15", + "10.0.4.15", "10.0.5.15", "10.0.6.15"} + DefaultCIDRPrivateSubnets [6]string = [6]string{ + "10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24", + "10.0.104.0/24", "10.0.105.0/24", "10.0.106.0/24"} + DefaultCIDRIntraSubnets [6]string = [6]string{ + "10.0.201.0/24", "10.0.202.0/24", "10.0.203.0/24", + "10.0.204.0/24", "10.0.205.0/24", "10.0.206.0/24"} DefaultAvailabilityZones [3]string = [3]string{ "us-east-1b", "us-east-1c", "us-east-1d"} DefaultRegion string = "us-east-1" ) +type natgatewayType string + +var ( + NONE natgatewayType = "none" + SINGLE natgatewayType = "single" + ALL natgatewayType = "all" +) + type NetworkRequest struct { CIDR string Name string @@ -39,7 +51,7 @@ type NetworkRequest struct { PublicSubnetsCIDRs []string PrivateSubnetsCIDRs []string IntraSubnetsCIDRs []string - SingleNatGateway bool + NatGatewayType natgatewayType PublicToIntra *bool } @@ -56,11 +68,11 @@ func DefaultNetworkRequest(name, regionName string) NetworkRequest { return NetworkRequest{ Name: name, CIDR: DefaultCIDRNetwork, - AvailabilityZones: data.GetAvailabilityZones()[:3], + AvailabilityZones: data.GetAvailabilityZones("")[:3], PublicSubnetsCIDRs: DefaultCIDRPublicSubnets[:], PrivateSubnetsCIDRs: DefaultCIDRPrivateSubnets[:], IntraSubnetsCIDRs: DefaultCIDRIntraSubnets[:], - SingleNatGateway: false} + NatGatewayType: ALL} } @@ -144,21 +156,21 @@ func (r NetworkRequest) managePublicSubnets(vpc *ec2.Vpc, func (r NetworkRequest) managePrivateSubnets(vpc *ec2.Vpc, ngws []*ec2.NatGateway, ctx *pulumi.Context, namePrefix string) (subnets []*subnet.PrivateSubnetResources, err error) { - return managePrivateSubnets(vpc, ngws, ctx, r.PrivateSubnetsCIDRs, r.AvailabilityZones, r.Name, namePrefix, r.SingleNatGateway) + return managePrivateSubnets(vpc, ngws, ctx, r.PrivateSubnetsCIDRs, r.AvailabilityZones, r.Name, namePrefix, r.NatGatewayType) } func (r NetworkRequest) manageIntraSubnets(vpc *ec2.Vpc, ctx *pulumi.Context, namePrefix string) (subnets []*subnet.PrivateSubnetResources, err error) { - return managePrivateSubnets(vpc, nil, ctx, r.IntraSubnetsCIDRs, r.AvailabilityZones, r.Name, namePrefix, r.SingleNatGateway) + return managePrivateSubnets(vpc, nil, ctx, r.IntraSubnetsCIDRs, r.AvailabilityZones, r.Name, namePrefix, r.NatGatewayType) } func managePrivateSubnets(vpc *ec2.Vpc, ngws []*ec2.NatGateway, ctx *pulumi.Context, - snsCIDRs, azs []string, name, namePrefix string, singleNatGateway bool) (subnets []*subnet.PrivateSubnetResources, err error) { + snsCIDRs, azs []string, name, namePrefix string, ngwType natgatewayType) (subnets []*subnet.PrivateSubnetResources, err error) { if len(snsCIDRs) > 0 { for i := 0; i < len(snsCIDRs); i++ { privateSNRequest := subnet.PrivateSubnetRequest{ VPC: vpc, - NatGateway: getNatGateway(singleNatGateway, ngws, i), + NatGateway: getNatGateway(ngwType, ngws, i), CIDR: snsCIDRs[i], AvailabilityZone: azs[i], Name: fmt.Sprintf("%s%s%d", namePrefix, name, i)} @@ -173,7 +185,7 @@ func managePrivateSubnets(vpc *ec2.Vpc, ngws []*ec2.NatGateway, ctx *pulumi.Cont } func (r NetworkRequest) checkIfNatGatewayRequired(i int) bool { - return r.SingleNatGateway && i == 0 || len(r.PrivateSubnetsCIDRs) > 0 + return r.NatGatewayType != NONE || r.NatGatewayType == SINGLE && i == 0 || len(r.PrivateSubnetsCIDRs) > 0 } func getNatGateways(source []*subnet.PublicSubnetResources) (ngws []*ec2.NatGateway) { @@ -183,11 +195,11 @@ func getNatGateways(source []*subnet.PublicSubnetResources) (ngws []*ec2.NatGate return } -func getNatGateway(singleNatGateway bool, ngws []*ec2.NatGateway, i int) *ec2.NatGateway { +func getNatGateway(ngwType natgatewayType, ngws []*ec2.NatGateway, i int) *ec2.NatGateway { if ngws == nil { return nil } - if singleNatGateway { + if ngwType == SINGLE { return ngws[0] } return ngws[i] diff --git a/pkg/provider/aws/modules/serverless/serverless.go b/pkg/provider/aws/modules/serverless/serverless.go index 05b112684..ae7b29423 100644 --- a/pkg/provider/aws/modules/serverless/serverless.go +++ b/pkg/provider/aws/modules/serverless/serverless.go @@ -1,32 +1,57 @@ package serverless import ( - "encoding/json" "fmt" - "log" - "strconv" - "strings" - "time" - "github.com/pulumi/pulumi-aws-native/sdk/go/aws/scheduler" - "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs" - "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" - "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/awsx" awsxecs "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/ecs" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/redhat-developer/mapt/pkg/manager" maptContext "github.com/redhat-developer/mapt/pkg/manager/context" - "github.com/redhat-developer/mapt/pkg/provider/aws/data" + "github.com/redhat-developer/mapt/pkg/provider/aws" "github.com/redhat-developer/mapt/pkg/util" - - resourcesUtil "github.com/redhat-developer/mapt/pkg/util/resources" + "github.com/redhat-developer/mapt/pkg/util/logging" ) -var ( - ErrInvalidBackedURLForTimeout = fmt.Errorf("timeout can action can not be set due to backed url pointing to local file. Please use external storage or remote timeout option") -) +// function to create a mapt servless cmd which will be executed repeatedly +// interval should match expected expression +// https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html +func Create(args *ServerlessArgs) error { + // Initially manage it by setup, may we need to customize the region + // + // THis was initially created for mac, if no FixedLocation we may + // on a situation where region differs from resources managed..is this working?? + r := request(args) + stack := manager.Stack{ + StackName: maptContext.StackNameByProject(maptServerlessDefaultPrefix), + ProjectName: fmt.Sprintf("%s-%s", r.prefix, maptContext.ProjectName()), + BackedURL: maptContext.BackedURL(), + ProviderCredentials: aws.DefaultCredentials, + DeployFunc: r.deploy, + } + _, err := manager.UpStack(stack) + return err +} + +func Destroy(prefix *string) (err error) { + logging.Debug("Destroy serverless resources") + prefixValue := util.If(prefix != nil, + *prefix, + defaultPrefix) + return aws.DestroyStack( + aws.DestroyStackRequest{ + ProjectName: fmt.Sprintf("%s-%s", + prefixValue, + maptContext.ProjectName()), + Stackname: maptServerlessDefaultPrefix, + }) +} + +func Deploy(ctx *pulumi.Context, args *ServerlessArgs) (*awsxecs.FargateTaskDefinition, error) { + return request(args).resources(ctx) +} func OneTimeDelayedTask(ctx *pulumi.Context, - region, prefix, componentID string, + containerName, region, prefix, componentID string, cmd string, delay string) error { if err := checkBackedURLForServerless(); err != nil { @@ -37,9 +62,10 @@ func OneTimeDelayedTask(ctx *pulumi.Context, return err } r := &serverlessRequestArgs{ + containerName: containerName, region: region, command: cmd, - scheduleType: OneTime, + scheduleType: &OneTime, scheduleExpression: se, prefix: prefix, componentID: componentID, @@ -47,325 +73,3 @@ func OneTimeDelayedTask(ctx *pulumi.Context, return r.deploy(ctx) } - -func checkBackedURLForServerless() error { - return util.If( - strings.HasPrefix(maptContext.BackedURL(), "file:///"), - ErrInvalidBackedURLForTimeout, - nil) -} - -func (a *serverlessRequestArgs) deploy(ctx *pulumi.Context) error { - // Get the pre configured cluster to handle serverless exectucions - clusterArn, err := getClusterArn(ctx, - a.region, - a.prefix, - a.componentID) - if err != nil { - return err - } - roleArn, err := getTaskRole(ctx, - a.prefix, - a.componentID) - if err != nil { - return err - } - limitCPUasInt, err := strconv.Atoi(LimitCPU) - if err != nil { - return err - } - limitMemoryasInt, err := strconv.Atoi(LimitMemory) - if err != nil { - return err - } - lga := &awsx.DefaultLogGroupArgs{ - Args: &awsx.LogGroupArgs{ - SkipDestroy: pulumi.Bool(true), - RetentionInDays: pulumi.Int(3)}} - if len(a.logGroupName) > 0 { - lga.Args.SkipDestroy = pulumi.Bool(false) - lga.Args.Name = pulumi.String(a.logGroupName) - } - td, err := awsxecs.NewFargateTaskDefinition(ctx, - resourcesUtil.GetResourceName(a.prefix, a.componentID, "fg-task"), - &awsxecs.FargateTaskDefinitionArgs{ - Container: &awsxecs.TaskDefinitionContainerDefinitionArgs{ - Image: pulumi.String(maptContext.OCI), - Command: pulumi.ToStringArray(strings.Fields(a.command)), - Cpu: pulumi.Int(limitCPUasInt), - Memory: pulumi.Int(limitMemoryasInt), - }, - Cpu: pulumi.String(LimitCPU), - Memory: pulumi.String(LimitMemory), - ExecutionRole: &awsx.DefaultRoleWithPolicyArgs{ - RoleArn: roleArn, - }, - TaskRole: &awsx.DefaultRoleWithPolicyArgs{ - RoleArn: roleArn, - }, - LogGroup: lga, - }) - if err != nil { - return err - } - sRoleArn, err := getSchedulerRole(ctx, - a.prefix, - a.componentID) - if err != nil { - return err - } - subnetID, err := data.GetRandomPublicSubnet(a.region) - if err != nil { - return err - } - se := scheduleExpressionByType(a.scheduleType, a.scheduleExpression) - _, err = scheduler.NewSchedule(ctx, - resourcesUtil.GetResourceName(a.prefix, a.componentID, "fgs"), - &scheduler.ScheduleArgs{ - FlexibleTimeWindow: scheduler.ScheduleFlexibleTimeWindowArgs{ - Mode: scheduler.ScheduleFlexibleTimeWindowModeFlexible, - MaximumWindowInMinutes: pulumi.Float64(1), - }, - Target: scheduler.ScheduleTargetArgs{ - EcsParameters: scheduler.ScheduleEcsParametersArgs{ - TaskDefinitionArn: td.TaskDefinition.Arn(), - LaunchType: scheduler.ScheduleLaunchTypeFargate, - NetworkConfiguration: scheduler.ScheduleNetworkConfigurationArgs{ - // https://github.com/aws/aws-cdk/issues/13348#issuecomment-1539336376 - AwsvpcConfiguration: scheduler.ScheduleAwsVpcConfigurationArgs{ - AssignPublicIp: scheduler.ScheduleAssignPublicIpEnabled, - Subnets: pulumi.StringArray{ - pulumi.String(*subnetID), - }, - }, - }, - }, - Arn: clusterArn, - RoleArn: sRoleArn, - }, - ScheduleExpression: pulumi.String(*se), - ScheduleExpressionTimezone: pulumi.String(data.RegionTimezones[a.region]), - }) - if err != nil { - return err - } - return nil -} - -// As part of the runtime for serverless invocation we need a fixed cluster spec on the region as so if -// it exists it will pick the cluster otherwise it will create and will not be deleted -func getClusterArn(ctx *pulumi.Context, region, prefix, componentID string) (*pulumi.StringOutput, error) { - clusterName := fmt.Sprintf("%s-%s", maptServerlessDefaultPrefix, "cluster") - clusterArn, err := data.GetCluster(clusterName, region) - if err != nil { - if err == data.ErrECSClusterNotFound { - if cluster, err := ecs.NewCluster(ctx, - resourcesUtil.GetResourceName(prefix, componentID, "cluster"), - &ecs.ClusterArgs{ - Tags: maptContext.ResourceTags(), - Name: pulumi.String(clusterName), - }, - pulumi.RetainOnDelete(true)); err != nil { - return nil, err - } else { - return &cluster.Arn, nil - } - } else { - return nil, fmt.Errorf("error getting cluster for serverless mode. %w", err) - } - } - carn := pulumi.String(*clusterArn).ToStringOutput() - return &carn, nil -} - -// As part of the runtime for serverless invocation we need a fixed role for task execution the region as so if -// it exists it will pick the role otherwise it will create and will not be deleted -func getTaskRole(ctx *pulumi.Context, prefix, componentID string) (*pulumi.StringOutput, error) { - roleName := fmt.Sprintf("%s-%s", maptServerlessDefaultPrefix, "role") - roleArn, err := data.GetRole(roleName) - if err != nil { - if role, err := createTaskRole(ctx, roleName, prefix, componentID); err != nil { - return nil, err - } else { - return &role.Arn, nil - } - } - rarn := pulumi.String(*roleArn).ToStringOutput() - return &rarn, nil -} - -// https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html -// https://docs.aws.amazon.com/AmazonECS/latest/developerguide/security-iam-roles.html -func createTaskRole(ctx *pulumi.Context, roleName, prefix, componentID string) (*iam.Role, error) { - trustPolicyContent, err := json.Marshal(map[string]interface{}{ - "Version": "2012-10-17", - "Statement": []map[string]interface{}{ - { - "Effect": "Allow", - "Principal": map[string]interface{}{ - "Service": "ecs-tasks.amazonaws.com", - }, - "Action": "sts:AssumeRole", - }, - }, - }) - if err != nil { - return nil, err - } - // Need to creeate policies and attach - r, err := iam.NewRole(ctx, - resourcesUtil.GetResourceName(prefix, componentID, "role"), - &iam.RoleArgs{ - Name: pulumi.String(roleName), - AssumeRolePolicy: pulumi.String(string(trustPolicyContent)), - Tags: maptContext.ResourceTags(), - }, - pulumi.RetainOnDelete(true), - ) - if err != nil { - return nil, err - } - policyContent, err := json.Marshal(map[string]interface{}{ - "Version": "2012-10-17", - "Statement": []map[string]interface{}{ - { - "Effect": "Allow", - "Action": []string{ - "s3:*", - "ec2:*", - "logs:*", - "cloudformation:*", - "scheduler:*", - "ssm:*", - }, - "Resource": []string{ - "*", - }, - }, - }, - }) - if err != nil { - return nil, err - } - if _, err = iam.NewRolePolicy(ctx, - resourcesUtil.GetResourceName(prefix, componentID, "ecs-role-policy"), - &iam.RolePolicyArgs{ - Role: r.ID(), - Policy: pulumi.String(string(policyContent)), - }, - pulumi.RetainOnDelete(true)); err != nil { - return nil, err - } - return r, nil -} - -// As part of the runtime for serverless invocation we need a fixed role for task execution the region as so if -// it exists it will pick the role otherwise it will create and will not be deleted -func getSchedulerRole(ctx *pulumi.Context, prefix, componentID string) (*pulumi.StringOutput, error) { - roleName := fmt.Sprintf("%s-%s", maptServerlessDefaultPrefix, "sch-role") - roleArn, err := data.GetRole(roleName) - if err != nil { - if role, err := createSchedulerRole(ctx, roleName, prefix, componentID); err != nil { - return nil, err - } else { - return &role.Arn, nil - } - } - rarn := pulumi.String(*roleArn).ToStringOutput() - return &rarn, nil -} - -// https://docs.aws.amazon.com/scheduler/latest/UserGuide/setting-up.html#setting-up-execution-role -func createSchedulerRole(ctx *pulumi.Context, roleName, prefix, componentID string) (*iam.Role, error) { - trustPolicyContent, err := json.Marshal(map[string]interface{}{ - "Version": "2012-10-17", - "Statement": []map[string]interface{}{ - { - "Effect": "Allow", - "Principal": map[string]interface{}{ - "Service": "scheduler.amazonaws.com", - }, - "Action": "sts:AssumeRole", - }, - }, - }) - if err != nil { - return nil, err - } - // Need to creeate policies and attach - r, err := iam.NewRole(ctx, - resourcesUtil.GetResourceName(prefix, componentID, "sch-role"), - &iam.RoleArgs{ - Name: pulumi.String(roleName), - AssumeRolePolicy: pulumi.String(string(trustPolicyContent)), - Tags: maptContext.ResourceTags(), - }, - pulumi.RetainOnDelete(true)) - if err != nil { - return nil, err - } - policyContent, err := json.Marshal(map[string]interface{}{ - "Version": "2012-10-17", - "Statement": []map[string]interface{}{ - { - "Effect": "Allow", - "Action": []string{ - "s3:*", - "ec2:*", - "ecs:*", - "iam:PassRole", - "logs:*", - "cloudformation:*", - "scheduler:*", - "ssm:*", - }, - "Resource": []string{ - "*", - }, - }, - }, - }) - if err != nil { - return nil, err - } - if _, err = iam.NewRolePolicy(ctx, - resourcesUtil.GetResourceName(prefix, componentID, "sche-role-policy"), - &iam.RolePolicyArgs{ - Role: r.ID(), - Policy: pulumi.String(string(policyContent)), - }, - pulumi.RetainOnDelete(true)); err != nil { - return nil, err - } - return r, nil -} - -func generateOneTimeScheduleExpression(region, delay string) (string, error) { - location, err := time.LoadLocation(data.RegionTimezones[region]) - if err != nil { - log.Fatal("Failed to load timezone:", err) - } - // Get the current time in that timezone - currentTime := time.Now().In(location) - // Parse the timeout duration - duration, err := time.ParseDuration(delay) - if err != nil { - return "", fmt.Errorf("invalid timeout format: %v", err) - } - // Add the duration to the current time - futureTime := currentTime.Add(duration) - se := futureTime.Format("2006-01-02T15:04:05") - return se, nil -} - -func scheduleExpressionByType(st scheduleType, se string) *string { - switch st { - case Repeat: - e := fmt.Sprintf("rate(%s)", se) - return &e - case OneTime: - e := fmt.Sprintf("at(%s)", se) - return &e - } - return nil -} diff --git a/pkg/provider/aws/modules/serverless/stack.go b/pkg/provider/aws/modules/serverless/stack.go deleted file mode 100644 index ebc89d984..000000000 --- a/pkg/provider/aws/modules/serverless/stack.go +++ /dev/null @@ -1,49 +0,0 @@ -package serverless - -import ( - "os" - - "github.com/redhat-developer/mapt/pkg/manager" - maptContext "github.com/redhat-developer/mapt/pkg/manager/context" - "github.com/redhat-developer/mapt/pkg/provider/aws" - "github.com/redhat-developer/mapt/pkg/util/logging" -) - -// function to create a mapt servless cmd which will be executed repeatedly -// interval should match expected expression -// https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html -func Create(command string, scheduleType scheduleType, schedulexpression, logGroupName string) error { - // Initially manage it by setup, may we need to customize the region - // - // THis was initially created for mac, if no FixedLocation we may - // on a situation where region differs from resources managed..is this working?? - region := os.Getenv("AWS_DEFAULT_REGION") - r := &serverlessRequestArgs{ - region: region, - command: command, - scheduleType: scheduleType, - scheduleExpression: schedulexpression, - logGroupName: logGroupName, - // Being isolated stack these values - // do not care - prefix: "mapt", - componentID: "sf", - } - stack := manager.Stack{ - StackName: maptContext.StackNameByProject(maptServerlessDefaultPrefix), - ProjectName: maptContext.ProjectName(), - BackedURL: maptContext.BackedURL(), - ProviderCredentials: aws.DefaultCredentials, - DeployFunc: r.deploy, - } - _, err := manager.UpStack(stack) - return err -} - -func Destroy() (err error) { - logging.Debug("Destroy serverless resources") - return aws.DestroyStack( - aws.DestroyStackRequest{ - Stackname: maptServerlessDefaultPrefix, - }) -} diff --git a/pkg/provider/aws/modules/serverless/types.go b/pkg/provider/aws/modules/serverless/types.go index f0d38f7d5..6b8e5ae1b 100644 --- a/pkg/provider/aws/modules/serverless/types.go +++ b/pkg/provider/aws/modules/serverless/types.go @@ -1,12 +1,29 @@ package serverless -var ( - // stackName = "mapt-serverless" +import ( + "fmt" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +const ( + defaultPrefix string = "mapt" + defaultComponentID string = "sf" +) +var ( // This is mostly used to prefix resources used by mapt on serverless mode // i.e. ECS clusters which are created and kept after destroy as they always // will be used by mapt serverless features maptServerlessDefaultPrefix = "mapt-serverless-manager" + MaptServerlessClusterName = fmt.Sprintf("%s-%s", maptServerlessDefaultPrefix, "cluster") + maptServerlessExecRoleName = fmt.Sprintf("%s-%s", maptServerlessDefaultPrefix, "sch-role") +) + +const ( + TaskExecDefaultSubnetID = "default_subnetid" + TaskExecDefaultVPCID = "default_vpcid" + TaskExecDefaultSGID = "default_sgid" ) type scheduleType string @@ -22,12 +39,28 @@ const ( LimitMemory = "2048" ) +type ServerlessArgs struct { + Prefix string + Region string + ContainerName string + Command string + // From here params are optional + LogGroupName string + Tags map[string]string + // If no schedule info is added just create the task spec + ScheduleType *scheduleType + Schedulexpression string + // Optional information to use for execute the task + ExecutionDefaults map[string]*string +} + type serverlessRequestArgs struct { + containerName string // need this to find the right ECS cluster to run this serverless region string // command and scheduling to be used for it command string - scheduleType scheduleType + scheduleType *scheduleType scheduleExpression string // optional if we want to set the name for the log group were logs are sent @@ -35,4 +68,6 @@ type serverlessRequestArgs struct { logGroupName string // optional params in case we create serverless inside a stack prefix, componentID string + tags pulumi.StringMap + executionDefaults map[string]*string } diff --git a/pkg/provider/aws/modules/serverless/util.go b/pkg/provider/aws/modules/serverless/util.go new file mode 100644 index 000000000..a77ece097 --- /dev/null +++ b/pkg/provider/aws/modules/serverless/util.go @@ -0,0 +1,434 @@ +package serverless + +import ( + "encoding/json" + "fmt" + "log" + "strconv" + "strings" + "time" + + "github.com/pulumi/pulumi-aws-native/sdk/go/aws/scheduler" + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs" + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" + "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/awsx" + awsxecs "github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/ecs" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + maptContext "github.com/redhat-developer/mapt/pkg/manager/context" + "github.com/redhat-developer/mapt/pkg/provider/aws/data" + "github.com/redhat-developer/mapt/pkg/util" + + utilMaps "github.com/redhat-developer/mapt/pkg/util/maps" + resourcesUtil "github.com/redhat-developer/mapt/pkg/util/resources" +) + +var ( + ErrInvalidBackedURLForTimeout = fmt.Errorf("timeout can action can not be set due to backed url pointing to local file. Please use external storage or remote timeout option") +) + +func checkBackedURLForServerless() error { + return util.If( + strings.HasPrefix(maptContext.BackedURL(), "file:///"), + ErrInvalidBackedURLForTimeout, + nil) +} + +func request(args *ServerlessArgs) *serverlessRequestArgs { + r := &serverlessRequestArgs{ + containerName: args.ContainerName, + region: args.Region, + command: args.Command, + scheduleType: args.ScheduleType, + scheduleExpression: args.Schedulexpression, + logGroupName: args.LogGroupName, + prefix: util.If(len(args.Prefix) > 0, + args.Prefix, + string(defaultPrefix)), + componentID: defaultComponentID, + executionDefaults: args.ExecutionDefaults, + } + if args.Tags != nil { + r.tags = utilMaps.Convert(args.Tags, + func(name string) string { return name }, + func(value string) pulumi.StringInput { return pulumi.String(value) }) + } + return r +} + +func (a *serverlessRequestArgs) deploy(ctx *pulumi.Context) error { + _, err := a.resources(ctx) + return err +} + +func (a *serverlessRequestArgs) resources(ctx *pulumi.Context) (*awsxecs.FargateTaskDefinition, error) { + roleArn, err := getTaskRole(ctx, + a.prefix, + a.componentID) + if err != nil { + return nil, err + } + limitCPUasInt, err := strconv.Atoi(LimitCPU) + if err != nil { + return nil, err + } + limitMemoryasInt, err := strconv.Atoi(LimitMemory) + if err != nil { + return nil, err + } + lga := &awsx.DefaultLogGroupArgs{ + Args: &awsx.LogGroupArgs{ + SkipDestroy: pulumi.Bool(true), + RetentionInDays: pulumi.Int(3)}} + if len(a.logGroupName) > 0 { + lga.Args.SkipDestroy = pulumi.Bool(false) + lga.Args.Name = pulumi.String(a.logGroupName) + } + var tags pulumi.StringMap + // TODO review if this is required + // tags := maptContext.ResourceTags() + if a.tags != nil { + tags = a.tags + } + + edMap := utilMaps.Convert(a.executionDefaults, + func(name string) string { return name }, + func(value *string) pulumi.StringInput { return pulumi.String(*value) }) + tags = util.If(tags != nil, + utilMaps.Append(tags, edMap), + edMap) + td, err := awsxecs.NewFargateTaskDefinition(ctx, + resourcesUtil.GetResourceName(a.prefix, a.componentID, "fg-task"), + &awsxecs.FargateTaskDefinitionArgs{ + Container: &awsxecs.TaskDefinitionContainerDefinitionArgs{ + Name: pulumi.String(a.containerName), + Image: pulumi.String(maptContext.OCI), + Command: pulumi.ToStringArray(strings.Fields(a.command)), + Cpu: pulumi.Int(limitCPUasInt), + Memory: pulumi.Int(limitMemoryasInt), + Environment: awsxecs.TaskDefinitionKeyValuePairArray{ + awsxecs.TaskDefinitionKeyValuePairArgs{ + Name: pulumi.String("AWS_STS_REGIONAL_ENDPOINTS"), + Value: pulumi.String("regional")}, + // Credentials are coming from role on the task so we would no need to check them + // also we were hitting: Retrieving AWS account details: validating provider credentials: + // retrieving caller identity from STS: operation error STS: GetCallerIdentity, https response error StatusCode: 403 + awsxecs.TaskDefinitionKeyValuePairArgs{ + Name: pulumi.String("AWS_SKIP_CREDENTIALS_VALIDATION"), + Value: pulumi.String("true"), + }}, + }, + Cpu: pulumi.String(LimitCPU), + Memory: pulumi.String(LimitMemory), + ExecutionRole: &awsx.DefaultRoleWithPolicyArgs{ + RoleArn: roleArn, + }, + TaskRole: &awsx.DefaultRoleWithPolicyArgs{ + RoleArn: roleArn, + }, + LogGroup: lga, + Tags: pulumi.StringMapInput(tags), + }) + if err != nil { + return nil, err + } + + if len(a.scheduleExpression) > 0 { + if err = a.createScheduler(ctx, td); err != nil { + return nil, err + } + } + return td, nil +} + +func (a *serverlessRequestArgs) createScheduler(ctx *pulumi.Context, td *awsxecs.FargateTaskDefinition) error { + // Get the pre configured cluster to handle serverless exectucions + clusterArn, err := getClusterArn(ctx, + a.region, + a.prefix, + a.componentID) + if err != nil { + return err + } + sRoleArn, err := getSchedulerRole(ctx, + a.prefix, + a.componentID) + if err != nil { + return err + } + subnetId, err := a.schedulerSubnetId() + if err != nil { + return err + } + avc := scheduler.ScheduleAwsVpcConfigurationArgs{ + AssignPublicIp: scheduler.ScheduleAssignPublicIpEnabled, + Subnets: pulumi.StringArray{ + pulumi.String(*subnetId), + }, + } + sgID, ok := a.executionDefaults[TaskExecDefaultSGID] + if ok { + avc.SecurityGroups = pulumi.StringArray{ + pulumi.String(*sgID), + } + } + // Schedule + se := scheduleExpressionByType(a.scheduleType, a.scheduleExpression) + _, err = scheduler.NewSchedule(ctx, + resourcesUtil.GetResourceName(a.prefix, a.componentID, "fgs"), + &scheduler.ScheduleArgs{ + FlexibleTimeWindow: scheduler.ScheduleFlexibleTimeWindowArgs{ + Mode: scheduler.ScheduleFlexibleTimeWindowModeFlexible, + MaximumWindowInMinutes: pulumi.Float64(1), + }, + Target: scheduler.ScheduleTargetArgs{ + EcsParameters: scheduler.ScheduleEcsParametersArgs{ + TaskDefinitionArn: td.TaskDefinition.Arn(), + LaunchType: scheduler.ScheduleLaunchTypeFargate, + NetworkConfiguration: scheduler.ScheduleNetworkConfigurationArgs{ + // https://github.com/aws/aws-cdk/issues/13348#issuecomment-1539336376 + AwsvpcConfiguration: avc, + }, + }, + Arn: clusterArn, + RoleArn: sRoleArn, + }, + ScheduleExpression: pulumi.String(*se), + ScheduleExpressionTimezone: pulumi.String(data.RegionTimezones[a.region]), + }) + return err +} + +// 1. If we got TaskExecDefaultSubnetID we will use it +// 2. If we got TaskExecDefaultVPCID we will pick one subnet +// 3. we will pick one public subnet from region +func (a *serverlessRequestArgs) schedulerSubnetId() (*string, error) { + subnetID, ok := a.executionDefaults[TaskExecDefaultSubnetID] + if !ok { + vpcId, ok := a.executionDefaults[TaskExecDefaultVPCID] + if ok { + return data.GetSubnetID(&data.SubnetRequestArgs{ + Region: &a.region, + VpcId: vpcId, + }) + } + return data.GetRandomPublicSubnet(a.region) + } + return subnetID, nil +} + +// As part of the runtime for serverless invocation we need a fixed cluster spec on the region as so if +// it exists it will pick the cluster otherwise it will create and will not be deleted +func getClusterArn(ctx *pulumi.Context, region, prefix, componentID string) (*pulumi.StringOutput, error) { + clusterArn, err := data.GetCluster(MaptServerlessClusterName, region) + if err != nil { + if err == data.ErrECSClusterNotFound { + + if cluster, err := ecs.NewCluster(ctx, + resourcesUtil.GetResourceName(prefix, componentID, "cluster"), + &ecs.ClusterArgs{ + Tags: maptContext.ResourceTags(), + Name: pulumi.String(MaptServerlessClusterName), + }, + pulumi.RetainOnDelete(true)); err != nil { + return nil, err + } else { + return &cluster.Arn, nil + } + } else { + return nil, fmt.Errorf("error getting cluster for serverless mode. %w", err) + } + } + carn := pulumi.String(*clusterArn).ToStringOutput() + return &carn, nil +} + +// As part of the runtime for serverless invocation we need a fixed role for task execution the region as so if +// it exists it will pick the role otherwise it will create and will not be deleted +func getTaskRole(ctx *pulumi.Context, prefix, componentID string) (*pulumi.StringOutput, error) { + roleName := fmt.Sprintf("%s-%s", maptServerlessDefaultPrefix, "role") + roleArn, err := data.GetRole(roleName) + if err != nil { + if role, err := createTaskRole(ctx, roleName, prefix, componentID); err != nil { + return nil, err + } else { + return &role.Arn, nil + } + } + rarn := pulumi.String(*roleArn).ToStringOutput() + return &rarn, nil +} + +// https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html +// https://docs.aws.amazon.com/AmazonECS/latest/developerguide/security-iam-roles.html +func createTaskRole(ctx *pulumi.Context, roleName, prefix, componentID string) (*iam.Role, error) { + trustPolicyContent, err := json.Marshal(map[string]interface{}{ + "Version": "2012-10-17", + "Statement": []map[string]interface{}{ + { + "Effect": "Allow", + "Principal": map[string]interface{}{ + "Service": "ecs-tasks.amazonaws.com", + }, + "Action": "sts:AssumeRole", + }, + }, + }) + if err != nil { + return nil, err + } + // Need to creeate policies and attach + r, err := iam.NewRole(ctx, + resourcesUtil.GetResourceName(prefix, componentID, "role"), + &iam.RoleArgs{ + Name: pulumi.String(roleName), + AssumeRolePolicy: pulumi.String(string(trustPolicyContent)), + Tags: maptContext.ResourceTags(), + }, + pulumi.RetainOnDelete(true), + ) + if err != nil { + return nil, err + } + policyContent, err := json.Marshal(map[string]interface{}{ + "Version": "2012-10-17", + "Statement": []map[string]interface{}{ + { + "Effect": "Allow", + "Action": []string{ + "s3:*", + "ec2:*", + "logs:*", + "cloudformation:*", + "scheduler:*", + "sts:*", + }, + "Resource": []string{ + "*", + }, + }, + }, + }) + if err != nil { + return nil, err + } + if _, err = iam.NewRolePolicy(ctx, + resourcesUtil.GetResourceName(prefix, componentID, "ecs-role-policy"), + &iam.RolePolicyArgs{ + Role: r.ID(), + Policy: pulumi.String(string(policyContent)), + }, + pulumi.RetainOnDelete(true)); err != nil { + return nil, err + } + return r, nil +} + +// As part of the runtime for serverless invocation we need a fixed role for task execution the region as so if +// it exists it will pick the role otherwise it will create and will not be deleted +func getSchedulerRole(ctx *pulumi.Context, prefix, componentID string) (*pulumi.StringOutput, error) { + roleArn, err := data.GetRole(maptServerlessExecRoleName) + if err != nil { + if role, err := createSchedulerRole(ctx, maptServerlessExecRoleName, prefix, componentID); err != nil { + return nil, err + } else { + return &role.Arn, nil + } + } + rarn := pulumi.String(*roleArn).ToStringOutput() + return &rarn, nil +} + +// https://docs.aws.amazon.com/scheduler/latest/UserGuide/setting-up.html#setting-up-execution-role +func createSchedulerRole(ctx *pulumi.Context, roleName, prefix, componentID string) (*iam.Role, error) { + trustPolicyContent, err := json.Marshal(map[string]interface{}{ + "Version": "2012-10-17", + "Statement": []map[string]interface{}{ + { + "Effect": "Allow", + "Principal": map[string]interface{}{ + "Service": "scheduler.amazonaws.com", + }, + "Action": "sts:AssumeRole", + }, + }, + }) + if err != nil { + return nil, err + } + // Need to creeate policies and attach + r, err := iam.NewRole(ctx, + resourcesUtil.GetResourceName(prefix, componentID, "sch-role"), + &iam.RoleArgs{ + Name: pulumi.String(roleName), + AssumeRolePolicy: pulumi.String(string(trustPolicyContent)), + Tags: maptContext.ResourceTags(), + }, + pulumi.RetainOnDelete(true)) + if err != nil { + return nil, err + } + policyContent, err := json.Marshal(map[string]interface{}{ + "Version": "2012-10-17", + "Statement": []map[string]interface{}{ + { + "Effect": "Allow", + "Action": []string{ + "s3:*", + "ec2:*", + "ecs:*", + "iam:PassRole", + "logs:*", + "cloudformation:*", + "scheduler:*", + "sts:*", + }, + "Resource": []string{ + "*", + }, + }, + }, + }) + if err != nil { + return nil, err + } + if _, err = iam.NewRolePolicy(ctx, + resourcesUtil.GetResourceName(prefix, componentID, "sche-role-policy"), + &iam.RolePolicyArgs{ + Role: r.ID(), + Policy: pulumi.String(string(policyContent)), + }, + pulumi.RetainOnDelete(true)); err != nil { + return nil, err + } + return r, nil +} + +func generateOneTimeScheduleExpression(region, delay string) (string, error) { + location, err := time.LoadLocation(data.RegionTimezones[region]) + if err != nil { + log.Fatal("Failed to load timezone:", err) + } + // Get the current time in that timezone + currentTime := time.Now().In(location) + // Parse the timeout duration + duration, err := time.ParseDuration(delay) + if err != nil { + return "", fmt.Errorf("invalid timeout format: %v", err) + } + // Add the duration to the current time + futureTime := currentTime.Add(duration) + se := futureTime.Format("2006-01-02T15:04:05") + return se, nil +} + +func scheduleExpressionByType(st *scheduleType, se string) *string { + switch *st { + case Repeat: + e := fmt.Sprintf("rate(%s)", se) + return &e + case OneTime: + e := fmt.Sprintf("at(%s)", se) + return &e + } + return nil +} diff --git a/pkg/provider/aws/services/ec2/compute/compute.go b/pkg/provider/aws/services/ec2/compute/compute.go index d7b82c023..493a6bac8 100644 --- a/pkg/provider/aws/services/ec2/compute/compute.go +++ b/pkg/provider/aws/services/ec2/compute/compute.go @@ -4,11 +4,15 @@ import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/ec2" "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/redhat-developer/mapt/pkg/util/logging" ) +var ErrNoCapacity error = fmt.Errorf("no capacity: dedicated host had not been allocated") + type ReplaceRootVolumeRequest struct { Region string InstanceID string @@ -58,3 +62,69 @@ func ReplaceRootVolume(r ReplaceRootVolumeRequest) (*string, error) { } return rrvt.ReplaceRootVolumeTask.ReplaceRootVolumeTaskId, nil } + +// Create a dedicated host +func DedicatedHost(region, azId, instanceType *string, tags map[string]string) (*string, error) { + ctx := context.Background() + cfg, err := config.LoadDefaultConfig( + ctx, + config.WithRegion(*region)) + if err != nil { + return nil, err + } + client := ec2.NewFromConfig(cfg) + logging.Debugf("Trying to get a dedicated host %s in %s", *instanceType, *azId) + aResp, err := client.AllocateHosts( + context.Background(), + &ec2.AllocateHostsInput{ + AvailabilityZone: aws.String(*azId), + InstanceType: aws.String(*instanceType), + Quantity: aws.Int32(1), + }) + if err != nil { + return nil, err + } + if len(aResp.HostIds) == 0 { + return nil, ErrNoCapacity + } + hostID := aResp.HostIds[0] + if tags != nil { + var t []types.Tag + for k, v := range tags { + t = append(t, + types.Tag{ + Key: aws.String(k), + Value: aws.String(v)}) + } + _, err = client.CreateTags(ctx, + &ec2.CreateTagsInput{ + Resources: []string{hostID}, + Tags: t, + }) + } + return &hostID, err +} + +func DedicatedHostRelease(region, hostId *string) error { + ctx := context.Background() + cfg, err := config.LoadDefaultConfig( + ctx, + config.WithRegion(*region)) + if err != nil { + return err + } + client := ec2.NewFromConfig(cfg) + logging.Debugf("destroying dedicated host: %s", *hostId) + output, err := client.ReleaseHosts(ctx, + &ec2.ReleaseHostsInput{ + HostIds: []string{*hostId}, + }) + if err != nil { + return err + } + if len(output.Unsuccessful) == 1 { + return fmt.Errorf("unsuccessful releases: %v", output.Unsuccessful) + } + logging.Debugf("dedicated host: %s has been destroyed successfully", *hostId) + return nil +} diff --git a/pkg/provider/aws/services/ec2/keypair/keypair.go b/pkg/provider/aws/services/ec2/keypair/keypair.go index 526306ef4..1d552056b 100644 --- a/pkg/provider/aws/services/ec2/keypair/keypair.go +++ b/pkg/provider/aws/services/ec2/keypair/keypair.go @@ -54,7 +54,8 @@ func (r KeyPairRequest) create(ctx *pulumi.Context, name string, r.Name, &ec2.KeyPairArgs{ PublicKey: privateKey.PublicKeyOpenssh, - Tags: maptContext.ResourceTags()}) + Tags: maptContext.ResourceTags()}, + maptContext.CommonOptions(ctx)...) if err != nil { return nil, err } diff --git a/pkg/provider/aws/services/ec2/security-group/security-group.go b/pkg/provider/aws/services/ec2/security-group/security-group.go index c1847fa8b..f8febf99f 100644 --- a/pkg/provider/aws/services/ec2/security-group/security-group.go +++ b/pkg/provider/aws/services/ec2/security-group/security-group.go @@ -14,6 +14,8 @@ type IngressRules struct { Protocol string CidrBlocks string SG *ec2.SecurityGroup + // If it uses a pre existing SG + SGID *string } type SGRequest struct { @@ -21,6 +23,8 @@ type SGRequest struct { Description string IngressRules []IngressRules VPC *ec2.Vpc + // If it uses a pre existing VPC + VPCID *string } type SGResources struct { @@ -28,15 +32,23 @@ type SGResources struct { } func (r SGRequest) Create(ctx *pulumi.Context) (*SGResources, error) { + var vpcId pulumi.StringInput + if r.VPC != nil { + vpcId = r.VPC.ID() + } else if r.VPCID != nil { + vpcId = pulumi.String(*r.VPCID) + } + sga := &ec2.SecurityGroupArgs{ + Description: pulumi.String(r.Description), + VpcId: vpcId, + Ingress: getSecurityGroupIngressArray(r.IngressRules), + Egress: ec2.SecurityGroupEgressArray{egressAll}, + Tags: maptContext.ResourceTags(), + } sg, err := ec2.NewSecurityGroup(ctx, r.Name, - &ec2.SecurityGroupArgs{ - Description: pulumi.String(r.Description), - VpcId: r.VPC.ID(), - Ingress: getSecurityGroupIngressArray(r.IngressRules), - Egress: ec2.SecurityGroupEgressArray{egressAll}, - Tags: maptContext.ResourceTags(), - }) + sga, + maptContext.CommonOptions(ctx)...) if err != nil { return nil, err } @@ -53,6 +65,8 @@ func getSecurityGroupIngressArray(rules []IngressRules) (sgia ec2.SecurityGroupI } if r.SG != nil { args.SecurityGroups = pulumi.StringArray{r.SG.ID()} + } else if r.SGID != nil { + args.SecurityGroups = pulumi.StringArray{pulumi.String(*r.SGID)} } else if len(r.CidrBlocks) > 0 { args.CidrBlocks = pulumi.StringArray{pulumi.String(r.CidrBlocks)} } else { diff --git a/pkg/provider/aws/services/ecs/ecs.go b/pkg/provider/aws/services/ecs/ecs.go new file mode 100644 index 000000000..f22ad0867 --- /dev/null +++ b/pkg/provider/aws/services/ecs/ecs.go @@ -0,0 +1,80 @@ +package ecs + +import ( + "context" + "strings" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/service/ecs" + "github.com/aws/aws-sdk-go-v2/service/ecs/types" + "github.com/redhat-developer/mapt/pkg/provider/aws/data" +) + +func RunTaskWithCommand(region, + taskDefArn, clusterName, + containerName, command *string, + subnetID, sgID *string) error { + cfg, err := config.LoadDefaultConfig(context.TODO(), + config.WithRegion(*region), // + ) + if err != nil { + return err + } + client := ecs.NewFromConfig(cfg) + // Run the task + if subnetID == nil { + subnetID, err = data.GetRandomPublicSubnet(*region) + if err != nil { + return err + } + } + nc := &types.NetworkConfiguration{ + AwsvpcConfiguration: &types.AwsVpcConfiguration{ + Subnets: []string{*subnetID}, + AssignPublicIp: types.AssignPublicIpEnabled, + }, + } + if sgID != nil { + nc.AwsvpcConfiguration.SecurityGroups = []string{*sgID} + } + _, err = client.RunTask(context.TODO(), &ecs.RunTaskInput{ + Cluster: aws.String(*clusterName), + TaskDefinition: aws.String(*taskDefArn), + LaunchType: types.LaunchTypeFargate, + NetworkConfiguration: nc, + Overrides: &types.TaskOverride{ + ContainerOverrides: []types.ContainerOverride{ + { + Name: aws.String(*containerName), + Command: strings.Fields(*command), + }, + }, + }}) + if err != nil { + return err + } + return nil +} + +func GetTags(region, taskDefArn *string) (map[string]*string, error) { + cfg, err := config.LoadDefaultConfig(context.TODO(), + config.WithRegion(*region), // + ) + if err != nil { + return nil, err + } + client := ecs.NewFromConfig(cfg) + out, err := client.ListTagsForResource(context.TODO(), + &ecs.ListTagsForResourceInput{ + ResourceArn: aws.String(*taskDefArn), + }) + if err != nil { + return nil, err + } + var tags = make(map[string]*string) + for _, tag := range out.Tags { + tags[*tag.Key] = tag.Value + } + return tags, nil +} diff --git a/pkg/provider/aws/services/vpc/subnet/public.go b/pkg/provider/aws/services/vpc/subnet/public.go index 3a6f3f167..becd59a42 100644 --- a/pkg/provider/aws/services/vpc/subnet/public.go +++ b/pkg/provider/aws/services/vpc/subnet/public.go @@ -39,17 +39,18 @@ func (r PublicSubnetRequest) Create(ctx *pulumi.Context) (*PublicSubnetResources if err != nil { return nil, err } - eipName := fmt.Sprintf("%s-%s", "eip", r.Name) - eip, err := ec2.NewEip(ctx, - eipName, - &ec2.EipArgs{ - Vpc: pulumi.Bool(true), - }) - if err != nil { - return nil, err - } var n *ec2.NatGateway + var eip *ec2.Eip if r.AddNatGateway { + eipName := fmt.Sprintf("%s-%s", "eip", r.Name) + eip, err = ec2.NewEip(ctx, + eipName, + &ec2.EipArgs{ + Domain: pulumi.String("vpc"), + }) + if err != nil { + return nil, err + } nName := fmt.Sprintf("%s-%s", "natgateway", r.Name) n, err = ec2.NewNatGateway(ctx, nName, diff --git a/pkg/provider/azure/azure.go b/pkg/provider/azure/azure.go index 74a37bec1..137a586a8 100644 --- a/pkg/provider/azure/azure.go +++ b/pkg/provider/azure/azure.go @@ -5,6 +5,7 @@ import ( "slices" "strings" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/redhat-developer/mapt/pkg/manager" "github.com/redhat-developer/mapt/pkg/manager/credentials" "github.com/redhat-developer/mapt/pkg/util/logging" @@ -28,6 +29,10 @@ func (a *Azure) Init(backedURL string) error { return nil } +func (a *Azure) Custom(ctx *pulumi.Context) (*pulumi.ProviderResource, error) { + return nil, nil +} + // Envs required for auth with go sdk // https://learn.microsoft.com/es-es/azure/developer/go/azure-sdk-authentication?tabs=bash#service-principal-with-a-secret // do not match standard envs for pulumi envs for auth with native sdk diff --git a/pkg/util/maps/maps.go b/pkg/util/maps/maps.go index a5061ebd8..a994a12db 100644 --- a/pkg/util/maps/maps.go +++ b/pkg/util/maps/maps.go @@ -8,3 +8,15 @@ func Convert[X comparable, Y any, Z comparable, V any](source map[X]Y, } return result } + +// Append 2 maps if a key value exists on both foo will take preference +func Append[X comparable, Y any](foo map[X]Y, bar map[X]Y) map[X]Y { + var result = make(map[X]Y) + for k, v := range bar { + result[k] = v + } + for k, v := range foo { + result[k] = v + } + return result +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/CHANGELOG.md new file mode 100644 index 000000000..b7de8bad3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/CHANGELOG.md @@ -0,0 +1,606 @@ +# v1.26.3 (2025-04-10) + +* No change notes available for this release. + +# v1.26.2 (2025-04-03) + +* No change notes available for this release. + +# v1.26.1 (2025-03-04.2) + +* **Bug Fix**: Add assurance test for operation order. + +# v1.26.0 (2025-02-27) + +* **Feature**: Track credential providers via User-Agent Feature ids +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.19 (2025-02-18) + +* **Bug Fix**: Bump go version to 1.22 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.18 (2025-02-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.17 (2025-02-04) + +* No change notes available for this release. + +# v1.25.16 (2025-01-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.15 (2025-01-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.14 (2025-01-24) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.22.2. + +# v1.25.13 (2025-01-17) + +* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop. + +# v1.25.12 (2025-01-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.11 (2025-01-14) + +* No change notes available for this release. + +# v1.25.10 (2025-01-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.9 (2025-01-08) + +* No change notes available for this release. + +# v1.25.8 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.7 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.6 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.5 (2024-11-07) + +* **Bug Fix**: Adds case-insensitive handling of error message fields in service responses + +# v1.25.4 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.3 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.1 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.4 (2024-10-03) + +* No change notes available for this release. + +# v1.24.3 (2024-09-27) + +* No change notes available for this release. + +# v1.24.2 (2024-09-25) + +* No change notes available for this release. + +# v1.24.1 (2024-09-23) + +* No change notes available for this release. + +# v1.24.0 (2024-09-20) + +* **Feature**: Add tracing and metrics support to service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.8 (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.23.7 (2024-09-04) + +* No change notes available for this release. + +# v1.23.6 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.5 (2024-08-22) + +* No change notes available for this release. + +# v1.23.4 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.3 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.2 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.1 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.0 (2024-06-26) + +* **Feature**: Support list-of-string endpoint parameter. + +# v1.22.1 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.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.21.11 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.10 (2024-06-07) + +* **Bug Fix**: Add clock skew correction on all service clients +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.9 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.8 (2024-05-23) + +* No change notes available for this release. + +# v1.21.7 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.6 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.5 (2024-05-08) + +* **Bug Fix**: GoDoc improvement + +# v1.21.4 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.2 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.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.21.0 (2024-02-22) + +* **Feature**: Add middleware stack snapshot tests. + +# v1.20.3 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.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.20.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.20.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.19.7 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.6 (2023-12-20) + +* No change notes available for this release. + +# v1.19.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.19.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.19.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.4 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.18.3 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.1 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.15.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2023-08-01) + +* No change notes available for this release. + +# v1.15.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.16 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.15 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.14 (2023-06-15) + +* No change notes available for this release. + +# v1.14.13 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.12 (2023-06-01) + +* No change notes available for this release. + +# v1.14.11 (2023-05-04) + +* No change notes available for this release. + +# v1.14.10 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.9 (2023-04-10) + +* No change notes available for this release. + +# v1.14.8 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.7 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.6 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.5 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.14.4 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.3 (2023-02-15) + +* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. +* **Bug Fix**: Correct error type parsing for restJson services. + +# v1.14.2 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.1 (2023-01-23) + +* No change notes available for this release. + +# v1.14.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.13.26 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.25 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.24 (2022-11-22) + +* No change notes available for this release. + +# v1.13.23 (2022-11-16) + +* No change notes available for this release. + +# v1.13.22 (2022-11-10) + +* No change notes available for this release. + +# v1.13.21 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.20 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.19 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.18 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.17 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.16 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.15 (2022-08-30) + +* No change notes available for this release. + +# v1.13.14 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.13 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.12 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.11 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.10 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.9 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.8 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.7 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.6 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.5 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2022-03-28) + +* No change notes available for this release. + +# v1.13.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2021-12-21) + +* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. +* **Feature**: Updated to latest service endpoints + +# v1.8.2 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-11-12) + +* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. +* **Documentation**: Updated service to latest API model. + +# v1.7.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.2 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-08-27) + +* **Feature**: Updated API model to latest revision. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.3 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.2 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/LICENSE.txt new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_client.go new file mode 100644 index 000000000..9b24aaf84 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_client.go @@ -0,0 +1,944 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + 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" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "Resource Groups Tagging API" +const ServiceAPIVersion = "2017-01-26" + +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/resourcegroupstaggingapi") + 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/resourcegroupstaggingapi") +} + +// Client provides the API client to make operations call for AWS Resource Groups +// Tagging API. +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 +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +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, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + 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/resourcegroupstaggingapi") + }) + 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 +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + 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{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// 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, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "resourcegroupstaggingapi", goModuleVersion) + if len(options.AppID) > 0 { + 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 +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +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 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/resourcegroupstaggingapi") + }) + if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + 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{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +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) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_DescribeReportCreation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_DescribeReportCreation.go new file mode 100644 index 000000000..6ace0b00d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_DescribeReportCreation.go @@ -0,0 +1,174 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +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" +) + +// Describes the status of the StartReportCreation operation. +// +// You can call this operation only from the organization's management account and +// from the us-east-1 Region. +func (c *Client) DescribeReportCreation(ctx context.Context, params *DescribeReportCreationInput, optFns ...func(*Options)) (*DescribeReportCreationOutput, error) { + if params == nil { + params = &DescribeReportCreationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeReportCreation", params, optFns, c.addOperationDescribeReportCreationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeReportCreationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeReportCreationInput struct { + noSmithyDocumentSerde +} + +type DescribeReportCreationOutput struct { + + // Details of the common errors that all operations return. + ErrorMessage *string + + // The path to the Amazon S3 bucket where the report was stored on creation. + S3Location *string + + // The date and time that the report was started. + StartDate *string + + // Reports the status of the operation. + // + // The operation status can be one of the following: + // + // - RUNNING - Report creation is in progress. + // + // - SUCCEEDED - Report creation is complete. You can open the report from the + // Amazon S3 bucket that you specified when you ran StartReportCreation . + // + // - FAILED - Report creation timed out or the Amazon S3 bucket is not + // accessible. + // + // - NO REPORT - No report was generated in the last 90 days. + Status *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeReportCreationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeReportCreation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeReportCreation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReportCreation"); 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_opDescribeReportCreation(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 = 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_opDescribeReportCreation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeReportCreation", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go new file mode 100644 index 000000000..45c208a93 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go @@ -0,0 +1,327 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a table that shows counts of resources that are noncompliant with their +// tag policies. +// +// For more information on tag policies, see [Tag Policies] in the Organizations User Guide. +// +// You can call this operation only from the organization's management account and +// from the us-east-1 Region. +// +// This operation supports pagination, where the response can be sent in multiple +// pages. You should check the PaginationToken response parameter to determine if +// there are additional results available to return. Repeat the query, passing the +// PaginationToken response parameter value as an input to the next request until +// you recieve a null value. A null value for PaginationToken indicates that there +// are no more results waiting to be returned. +// +// [Tag Policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html +func (c *Client) GetComplianceSummary(ctx context.Context, params *GetComplianceSummaryInput, optFns ...func(*Options)) (*GetComplianceSummaryOutput, error) { + if params == nil { + params = &GetComplianceSummaryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetComplianceSummary", params, optFns, c.addOperationGetComplianceSummaryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetComplianceSummaryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetComplianceSummaryInput struct { + + // Specifies a list of attributes to group the counts of noncompliant resources + // by. If supplied, the counts are sorted by those attributes. + GroupBy []types.GroupByAttribute + + // Specifies the maximum number of results to be returned in each page. A query + // can return fewer than this maximum, even if there are more results still to + // return. You should always check the PaginationToken response value to see if + // there are more results. You can specify a minimum of 1 and a maximum value of + // 100. + MaxResults *int32 + + // Specifies a PaginationToken response value from a previous request to indicate + // that you want the next page of results. Leave this parameter empty in your + // initial request. + PaginationToken *string + + // Specifies a list of Amazon Web Services Regions to limit the output to. If you + // use this parameter, the count of returned noncompliant resources includes only + // resources in the specified Regions. + RegionFilters []string + + // Specifies that you want the response to include information for only resources + // of the specified types. The format of each resource type is + // service[:resourceType] . For example, specifying a resource type of ec2 returns + // all Amazon EC2 resources (which includes EC2 instances). Specifying a resource + // type of ec2:instance returns only EC2 instances. + // + // The string for each service name and resource type is the same as that embedded + // in a resource's Amazon Resource Name (ARN). Consult the [Amazon Web Services General Reference]for the following: + // + // - For a list of service name strings, see [Amazon Web Services Service Namespaces]. + // + // - For resource type strings, see [Example ARNs]. + // + // - For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]. + // + // You can specify multiple resource types by using a comma separated array. The + // array can include up to 100 items. Note that the length constraint requirement + // applies to each resource type filter. + // + // [Example ARNs]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-syntax + // [Amazon Web Services General Reference]: https://docs.aws.amazon.com/general/latest/gr/ + // [Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces + // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + ResourceTypeFilters []string + + // Specifies that you want the response to include information for only resources + // that have tags with the specified tag keys. If you use this parameter, the count + // of returned noncompliant resources includes only resources that have the + // specified tag keys. + TagKeyFilters []string + + // Specifies target identifiers (usually, specific account IDs) to limit the + // output by. If you use this parameter, the count of returned noncompliant + // resources includes only resources with the specified target IDs. + TargetIdFilters []string + + noSmithyDocumentSerde +} + +type GetComplianceSummaryOutput struct { + + // A string that indicates that there is more data available than this response + // contains. To receive the next part of the response, specify this response value + // as the PaginationToken value in the request for the next page. + PaginationToken *string + + // A table that shows counts of noncompliant resources. + SummaryList []types.Summary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetComplianceSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetComplianceSummary{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetComplianceSummary{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetComplianceSummary"); 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_opGetComplianceSummary(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 = 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 +} + +// GetComplianceSummaryPaginatorOptions is the paginator options for +// GetComplianceSummary +type GetComplianceSummaryPaginatorOptions struct { + // Specifies the maximum number of results to be returned in each page. A query + // can return fewer than this maximum, even if there are more results still to + // return. You should always check the PaginationToken response value to see if + // there are more results. You can specify a minimum of 1 and a maximum value of + // 100. + 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 +} + +// GetComplianceSummaryPaginator is a paginator for GetComplianceSummary +type GetComplianceSummaryPaginator struct { + options GetComplianceSummaryPaginatorOptions + client GetComplianceSummaryAPIClient + params *GetComplianceSummaryInput + nextToken *string + firstPage bool +} + +// NewGetComplianceSummaryPaginator returns a new GetComplianceSummaryPaginator +func NewGetComplianceSummaryPaginator(client GetComplianceSummaryAPIClient, params *GetComplianceSummaryInput, optFns ...func(*GetComplianceSummaryPaginatorOptions)) *GetComplianceSummaryPaginator { + if params == nil { + params = &GetComplianceSummaryInput{} + } + + options := GetComplianceSummaryPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetComplianceSummaryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.PaginationToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetComplianceSummaryPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetComplianceSummary page. +func (p *GetComplianceSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetComplianceSummaryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.GetComplianceSummary(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.PaginationToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// GetComplianceSummaryAPIClient is a client that implements the +// GetComplianceSummary operation. +type GetComplianceSummaryAPIClient interface { + GetComplianceSummary(context.Context, *GetComplianceSummaryInput, ...func(*Options)) (*GetComplianceSummaryOutput, error) +} + +var _ GetComplianceSummaryAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opGetComplianceSummary(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetComplianceSummary", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetResources.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetResources.go new file mode 100644 index 000000000..27ac81636 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetResources.go @@ -0,0 +1,387 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns all the tagged or previously tagged resources that are located in the +// specified Amazon Web Services Region for the account. +// +// Depending on what information you want returned, you can also specify the +// following: +// +// - Filters that specify what tags and resource types you want returned. The +// response includes all tags that are associated with the requested resources. +// +// - Information about compliance with the account's effective tag policy. For +// more information on tag policies, see [Tag Policies]in the Organizations User Guide. +// +// This operation supports pagination, where the response can be sent in multiple +// pages. You should check the PaginationToken response parameter to determine if +// there are additional results available to return. Repeat the query, passing the +// PaginationToken response parameter value as an input to the next request until +// you recieve a null value. A null value for PaginationToken indicates that there +// are no more results waiting to be returned. +// +// [Tag Policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html +func (c *Client) GetResources(ctx context.Context, params *GetResourcesInput, optFns ...func(*Options)) (*GetResourcesOutput, error) { + if params == nil { + params = &GetResourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResources", params, optFns, c.addOperationGetResourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourcesInput struct { + + // Specifies whether to exclude resources that are compliant with the tag policy. + // Set this to true if you are interested in retrieving information on + // noncompliant resources only. + // + // You can use this parameter only if the IncludeComplianceDetails parameter is + // also set to true . + ExcludeCompliantResources *bool + + // Specifies whether to include details regarding the compliance with the + // effective tag policy. Set this to true to determine whether resources are + // compliant with the tag policy and to get details. + IncludeComplianceDetails *bool + + // Specifies a PaginationToken response value from a previous request to indicate + // that you want the next page of results. Leave this parameter empty in your + // initial request. + PaginationToken *string + + // Specifies a list of ARNs of resources for which you want to retrieve tag data. + // You can't specify both this parameter and any of the pagination parameters ( + // ResourcesPerPage , TagsPerPage , PaginationToken ) in the same request. If you + // specify both, you get an Invalid Parameter exception. + // + // If a resource specified by this parameter doesn't exist, it doesn't generate an + // error; it simply isn't included in the response. + // + // An ARN (Amazon Resource Name) uniquely identifies a resource. For more + // information, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web Services General Reference. + // + // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + ResourceARNList []string + + // Specifies the resource types that you want included in the response. The format + // of each resource type is service[:resourceType] . For example, specifying a + // resource type of ec2 returns all Amazon EC2 resources (which includes EC2 + // instances). Specifying a resource type of ec2:instance returns only EC2 + // instances. + // + // The string for each service name and resource type is the same as that embedded + // in a resource's Amazon Resource Name (ARN). For the list of services whose + // resources you can use in this parameter, see [Services that support the Resource Groups Tagging API]. + // + // You can specify multiple resource types by using an array. The array can + // include up to 100 items. Note that the length constraint requirement applies to + // each resource type filter. For example, the following string would limit the + // response to only Amazon EC2 instances, Amazon S3 buckets, or any Audit Manager + // resource: + // + // ec2:instance,s3:bucket,auditmanager + // + // [Services that support the Resource Groups Tagging API]: https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/supported-services.html + ResourceTypeFilters []string + + // Specifies the maximum number of results to be returned in each page. A query + // can return fewer than this maximum, even if there are more results still to + // return. You should always check the PaginationToken response value to see if + // there are more results. You can specify a minimum of 1 and a maximum value of + // 100. + ResourcesPerPage *int32 + + // Specifies a list of TagFilters (keys and values) to restrict the output to only + // those resources that have tags with the specified keys and, if included, the + // specified values. Each TagFilter must contain a key with values optional. A + // request can include up to 50 keys, and each key can include up to 20 values. + // + // Note the following when deciding how to use TagFilters: + // + // - If you don't specify a TagFilter , the response includes all resources that + // are currently tagged or ever had a tag. Resources that currently don't have tags + // are shown with an empty tag set, like this: "Tags": [] . + // + // - If you specify more than one filter in a single request, the response + // returns only those resources that satisfy all filters. + // + // - If you specify a filter that contains more than one value for a key, the + // response returns resources that match any of the specified values for that key. + // + // - If you don't specify a value for a key, the response returns all resources + // that are tagged with that key, with any or no value. + // + // For example, for the following filters: filter1= {keyA,{value1}} , + // filter2={keyB,{value2,value3,value4}} , filter3= {keyC} : + // + // - GetResources({filter1}) returns resources tagged with key1=value1 + // + // - GetResources({filter2}) returns resources tagged with key2=value2 or + // key2=value3 or key2=value4 + // + // - GetResources({filter3}) returns resources tagged with any tag with the key + // key3 , and with any or no value + // + // - GetResources({filter1,filter2,filter3}) returns resources tagged with + // (key1=value1) and (key2=value2 or key2=value3 or key2=value4) and (key3, any or + // no value) + TagFilters []types.TagFilter + + // Amazon Web Services recommends using ResourcesPerPage instead of this parameter. + // + // A limit that restricts the number of tags (key and value pairs) returned by + // GetResources in paginated output. A resource with no tags is counted as having + // one tag (one key and value pair). + // + // GetResources does not split a resource and its associated tags across pages. If + // the specified TagsPerPage would cause such a break, a PaginationToken is + // returned in place of the affected resource and its tags. Use that token in + // another request to get the remaining data. For example, if you specify a + // TagsPerPage of 100 and the account has 22 resources with 10 tags each (meaning + // that each resource has 10 key and value pairs), the output will consist of three + // pages. The first page displays the first 10 resources, each with its 10 tags. + // The second page displays the next 10 resources, each with its 10 tags. The third + // page displays the remaining 2 resources, each with its 10 tags. + // + // You can set TagsPerPage to a minimum of 100 items up to a maximum of 500 items. + TagsPerPage *int32 + + noSmithyDocumentSerde +} + +type GetResourcesOutput struct { + + // A string that indicates that there is more data available than this response + // contains. To receive the next part of the response, specify this response value + // as the PaginationToken value in the request for the next page. + PaginationToken *string + + // A list of resource ARNs and the tags (keys and values) associated with each. + ResourceTagMappingList []types.ResourceTagMapping + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetResources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetResources{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetResources"); 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_opGetResources(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 = 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 +} + +// GetResourcesPaginatorOptions is the paginator options for GetResources +type GetResourcesPaginatorOptions struct { + // Specifies the maximum number of results to be returned in each page. A query + // can return fewer than this maximum, even if there are more results still to + // return. You should always check the PaginationToken response value to see if + // there are more results. You can specify a minimum of 1 and a maximum value of + // 100. + 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 +} + +// GetResourcesPaginator is a paginator for GetResources +type GetResourcesPaginator struct { + options GetResourcesPaginatorOptions + client GetResourcesAPIClient + params *GetResourcesInput + nextToken *string + firstPage bool +} + +// NewGetResourcesPaginator returns a new GetResourcesPaginator +func NewGetResourcesPaginator(client GetResourcesAPIClient, params *GetResourcesInput, optFns ...func(*GetResourcesPaginatorOptions)) *GetResourcesPaginator { + if params == nil { + params = &GetResourcesInput{} + } + + options := GetResourcesPaginatorOptions{} + if params.ResourcesPerPage != nil { + options.Limit = *params.ResourcesPerPage + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.PaginationToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourcesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetResources page. +func (p *GetResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.ResourcesPerPage = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.GetResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.PaginationToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// GetResourcesAPIClient is a client that implements the GetResources operation. +type GetResourcesAPIClient interface { + GetResources(context.Context, *GetResourcesInput, ...func(*Options)) (*GetResourcesOutput, error) +} + +var _ GetResourcesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opGetResources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetResources", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetTagKeys.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetTagKeys.go new file mode 100644 index 000000000..3e7e26444 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetTagKeys.go @@ -0,0 +1,249 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +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" +) + +// Returns all tag keys currently in use in the specified Amazon Web Services +// Region for the calling account. +// +// This operation supports pagination, where the response can be sent in multiple +// pages. You should check the PaginationToken response parameter to determine if +// there are additional results available to return. Repeat the query, passing the +// PaginationToken response parameter value as an input to the next request until +// you recieve a null value. A null value for PaginationToken indicates that there +// are no more results waiting to be returned. +func (c *Client) GetTagKeys(ctx context.Context, params *GetTagKeysInput, optFns ...func(*Options)) (*GetTagKeysOutput, error) { + if params == nil { + params = &GetTagKeysInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTagKeys", params, optFns, c.addOperationGetTagKeysMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTagKeysOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTagKeysInput struct { + + // Specifies a PaginationToken response value from a previous request to indicate + // that you want the next page of results. Leave this parameter empty in your + // initial request. + PaginationToken *string + + noSmithyDocumentSerde +} + +type GetTagKeysOutput struct { + + // A string that indicates that there is more data available than this response + // contains. To receive the next part of the response, specify this response value + // as the PaginationToken value in the request for the next page. + PaginationToken *string + + // A list of all tag keys in the Amazon Web Services account. + TagKeys []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTagKeysMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetTagKeys{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetTagKeys{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTagKeys"); 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_opGetTagKeys(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 = 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 +} + +// GetTagKeysPaginatorOptions is the paginator options for GetTagKeys +type GetTagKeysPaginatorOptions struct { + // 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 +} + +// GetTagKeysPaginator is a paginator for GetTagKeys +type GetTagKeysPaginator struct { + options GetTagKeysPaginatorOptions + client GetTagKeysAPIClient + params *GetTagKeysInput + nextToken *string + firstPage bool +} + +// NewGetTagKeysPaginator returns a new GetTagKeysPaginator +func NewGetTagKeysPaginator(client GetTagKeysAPIClient, params *GetTagKeysInput, optFns ...func(*GetTagKeysPaginatorOptions)) *GetTagKeysPaginator { + if params == nil { + params = &GetTagKeysInput{} + } + + options := GetTagKeysPaginatorOptions{} + + for _, fn := range optFns { + fn(&options) + } + + return &GetTagKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.PaginationToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTagKeysPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetTagKeys page. +func (p *GetTagKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTagKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.GetTagKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.PaginationToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// GetTagKeysAPIClient is a client that implements the GetTagKeys operation. +type GetTagKeysAPIClient interface { + GetTagKeys(context.Context, *GetTagKeysInput, ...func(*Options)) (*GetTagKeysOutput, error) +} + +var _ GetTagKeysAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opGetTagKeys(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTagKeys", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetTagValues.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetTagValues.go new file mode 100644 index 000000000..465a849be --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_GetTagValues.go @@ -0,0 +1,260 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +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" +) + +// Returns all tag values for the specified key that are used in the specified +// Amazon Web Services Region for the calling account. +// +// This operation supports pagination, where the response can be sent in multiple +// pages. You should check the PaginationToken response parameter to determine if +// there are additional results available to return. Repeat the query, passing the +// PaginationToken response parameter value as an input to the next request until +// you recieve a null value. A null value for PaginationToken indicates that there +// are no more results waiting to be returned. +func (c *Client) GetTagValues(ctx context.Context, params *GetTagValuesInput, optFns ...func(*Options)) (*GetTagValuesOutput, error) { + if params == nil { + params = &GetTagValuesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTagValues", params, optFns, c.addOperationGetTagValuesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTagValuesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTagValuesInput struct { + + // Specifies the tag key for which you want to list all existing values that are + // currently used in the specified Amazon Web Services Region for the calling + // account. + // + // This member is required. + Key *string + + // Specifies a PaginationToken response value from a previous request to indicate + // that you want the next page of results. Leave this parameter empty in your + // initial request. + PaginationToken *string + + noSmithyDocumentSerde +} + +type GetTagValuesOutput struct { + + // A string that indicates that there is more data available than this response + // contains. To receive the next part of the response, specify this response value + // as the PaginationToken value in the request for the next page. + PaginationToken *string + + // A list of all tag values for the specified key currently used in the specified + // Amazon Web Services Region for the calling account. + TagValues []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTagValuesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetTagValues{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetTagValues{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTagValues"); 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 = addOpGetTagValuesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTagValues(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 = 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 +} + +// GetTagValuesPaginatorOptions is the paginator options for GetTagValues +type GetTagValuesPaginatorOptions struct { + // 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 +} + +// GetTagValuesPaginator is a paginator for GetTagValues +type GetTagValuesPaginator struct { + options GetTagValuesPaginatorOptions + client GetTagValuesAPIClient + params *GetTagValuesInput + nextToken *string + firstPage bool +} + +// NewGetTagValuesPaginator returns a new GetTagValuesPaginator +func NewGetTagValuesPaginator(client GetTagValuesAPIClient, params *GetTagValuesInput, optFns ...func(*GetTagValuesPaginatorOptions)) *GetTagValuesPaginator { + if params == nil { + params = &GetTagValuesInput{} + } + + options := GetTagValuesPaginatorOptions{} + + for _, fn := range optFns { + fn(&options) + } + + return &GetTagValuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.PaginationToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTagValuesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetTagValues page. +func (p *GetTagValuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTagValuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.GetTagValues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.PaginationToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// GetTagValuesAPIClient is a client that implements the GetTagValues operation. +type GetTagValuesAPIClient interface { + GetTagValues(context.Context, *GetTagValuesInput, ...func(*Options)) (*GetTagValuesOutput, error) +} + +var _ GetTagValuesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opGetTagValues(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTagValues", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_StartReportCreation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_StartReportCreation.go new file mode 100644 index 000000000..6ef90df15 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_StartReportCreation.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +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" +) + +// Generates a report that lists all tagged resources in the accounts across your +// organization and tells whether each resource is compliant with the effective tag +// policy. Compliance data is refreshed daily. The report is generated +// asynchronously. +// +// The generated report is saved to the following location: +// +// s3://example-bucket/AwsTagPolicies/o-exampleorgid/YYYY-MM-ddTHH:mm:ssZ/report.csv +// +// You can call this operation only from the organization's management account and +// from the us-east-1 Region. +func (c *Client) StartReportCreation(ctx context.Context, params *StartReportCreationInput, optFns ...func(*Options)) (*StartReportCreationOutput, error) { + if params == nil { + params = &StartReportCreationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartReportCreation", params, optFns, c.addOperationStartReportCreationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartReportCreationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartReportCreationInput struct { + + // The name of the Amazon S3 bucket where the report will be stored; for example: + // + // awsexamplebucket + // + // For more information on S3 bucket requirements, including an example bucket + // policy, see the example S3 bucket policy on this page. + // + // This member is required. + S3Bucket *string + + noSmithyDocumentSerde +} + +type StartReportCreationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartReportCreationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartReportCreation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartReportCreation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartReportCreation"); 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 = addOpStartReportCreationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartReportCreation(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 = 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_opStartReportCreation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartReportCreation", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_TagResources.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_TagResources.go new file mode 100644 index 000000000..c6116d343 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_TagResources.go @@ -0,0 +1,209 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Applies one or more tags to the specified resources. Note the following: +// +// - Not all resources can have tags. For a list of services with resources that +// support tagging using this operation, see [Services that support the Resource Groups Tagging API]. If the resource doesn't yet +// support this operation, the resource's service might support tagging using its +// own API operations. For more information, refer to the documentation for that +// service. +// +// - Each resource can have up to 50 tags. For other limits, see [Tag Naming and Usage Conventions]in the Amazon +// Web Services General Reference. +// +// - You can only tag resources that are located in the specified Amazon Web +// Services Region for the Amazon Web Services account. +// +// - To add tags to a resource, you need the necessary permissions for the +// service that the resource belongs to as well as permissions for adding tags. For +// more information, see the documentation for each service. +// +// Do not store personally identifiable information (PII) or other confidential or +// sensitive information in tags. We use tags to provide you with billing and +// administration services. Tags are not intended to be used for private or +// sensitive data. +// +// # Minimum permissions +// +// In addition to the tag:TagResources permission required by this operation, you +// must also have the tagging permission defined by the service that created the +// resource. For example, to tag an Amazon EC2 instance using the TagResources +// operation, you must have both of the following permissions: +// +// - tag:TagResource +// +// - ec2:CreateTags +// +// [Services that support the Resource Groups Tagging API]: https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/supported-services.html +// [Tag Naming and Usage Conventions]: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html#tag-conventions +func (c *Client) TagResources(ctx context.Context, params *TagResourcesInput, optFns ...func(*Options)) (*TagResourcesOutput, error) { + if params == nil { + params = &TagResourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResources", params, optFns, c.addOperationTagResourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourcesInput struct { + + // Specifies the list of ARNs of the resources that you want to apply tags to. + // + // An ARN (Amazon Resource Name) uniquely identifies a resource. For more + // information, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web Services General Reference. + // + // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + // + // This member is required. + ResourceARNList []string + + // Specifies a list of tags that you want to add to the specified resources. A tag + // consists of a key and a value that you define. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourcesOutput struct { + + // A map containing a key-value pair for each failed item that couldn't be tagged. + // The key is the ARN of the failed resource. The value is a FailureInfo object + // that contains an error code, a status code, and an error message. If there are + // no errors, the FailedResourcesMap is empty. + FailedResourcesMap map[string]types.FailureInfo + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResources{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResources"); 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 = addOpTagResourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResources(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 = 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_opTagResources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResources", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_UntagResources.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_UntagResources.go new file mode 100644 index 000000000..662163941 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/api_op_UntagResources.go @@ -0,0 +1,197 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the specified tags from the specified resources. When you specify a tag +// key, the action removes both that key and its associated value. The operation +// succeeds even if you attempt to remove tags from a resource that were already +// removed. Note the following: +// +// - To remove tags from a resource, you need the necessary permissions for the +// service that the resource belongs to as well as permissions for removing tags. +// For more information, see the documentation for the service whose resource you +// want to untag. +// +// - You can only tag resources that are located in the specified Amazon Web +// Services Region for the calling Amazon Web Services account. +// +// # Minimum permissions +// +// In addition to the tag:UntagResources permission required by this operation, +// you must also have the remove tags permission defined by the service that +// created the resource. For example, to remove the tags from an Amazon EC2 +// instance using the UntagResources operation, you must have both of the +// following permissions: +// +// - tag:UntagResource +// +// - ec2:DeleteTags +func (c *Client) UntagResources(ctx context.Context, params *UntagResourcesInput, optFns ...func(*Options)) (*UntagResourcesOutput, error) { + if params == nil { + params = &UntagResourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResources", params, optFns, c.addOperationUntagResourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourcesInput struct { + + // Specifies a list of ARNs of the resources that you want to remove tags from. + // + // An ARN (Amazon Resource Name) uniquely identifies a resource. For more + // information, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web Services General Reference. + // + // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + // + // This member is required. + ResourceARNList []string + + // Specifies a list of tag keys that you want to remove from the specified + // resources. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourcesOutput struct { + + // A map containing a key-value pair for each failed item that couldn't be + // untagged. The key is the ARN of the failed resource. The value is a FailureInfo + // object that contains an error code, a status code, and an error message. If + // there are no errors, the FailedResourcesMap is empty. + FailedResourcesMap map[string]types.FailureInfo + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResources{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResources"); 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 = addOpUntagResourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResources(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 = 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_opUntagResources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResources", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/auth.go new file mode 100644 index 000000000..9887fd7a6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/auth.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "tagging") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/deserializers.go new file mode 100644 index 000000000..77a9f936a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/deserializers.go @@ -0,0 +1,2325 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsAwsjson11_deserializeOpDescribeReportCreation struct { +} + +func (*awsAwsjson11_deserializeOpDescribeReportCreation) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeReportCreation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeReportCreation(response, &metadata) + } + output := &DescribeReportCreationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDescribeReportCreationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDescribeReportCreation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("ConstraintViolationException", errorCode): + return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsAwsjson11_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetComplianceSummary struct { +} + +func (*awsAwsjson11_deserializeOpGetComplianceSummary) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetComplianceSummary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetComplianceSummary(response, &metadata) + } + output := &GetComplianceSummaryOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetComplianceSummaryOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetComplianceSummary(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("ConstraintViolationException", errorCode): + return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsAwsjson11_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetResources struct { +} + +func (*awsAwsjson11_deserializeOpGetResources) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetResources(response, &metadata) + } + output := &GetResourcesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetResourcesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("PaginationTokenExpiredException", errorCode): + return awsAwsjson11_deserializeErrorPaginationTokenExpiredException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsAwsjson11_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetTagKeys struct { +} + +func (*awsAwsjson11_deserializeOpGetTagKeys) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetTagKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetTagKeys(response, &metadata) + } + output := &GetTagKeysOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetTagKeysOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetTagKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("PaginationTokenExpiredException", errorCode): + return awsAwsjson11_deserializeErrorPaginationTokenExpiredException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsAwsjson11_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetTagValues struct { +} + +func (*awsAwsjson11_deserializeOpGetTagValues) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetTagValues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetTagValues(response, &metadata) + } + output := &GetTagValuesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetTagValuesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetTagValues(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("PaginationTokenExpiredException", errorCode): + return awsAwsjson11_deserializeErrorPaginationTokenExpiredException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsAwsjson11_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStartReportCreation struct { +} + +func (*awsAwsjson11_deserializeOpStartReportCreation) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartReportCreation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorStartReportCreation(response, &metadata) + } + output := &StartReportCreationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentStartReportCreationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorStartReportCreation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("ConcurrentModificationException", errorCode): + return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) + + case strings.EqualFold("ConstraintViolationException", errorCode): + return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsAwsjson11_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpTagResources struct { +} + +func (*awsAwsjson11_deserializeOpTagResources) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpTagResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorTagResources(response, &metadata) + } + output := &TagResourcesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentTagResourcesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorTagResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsAwsjson11_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagResources struct { +} + +func (*awsAwsjson11_deserializeOpUntagResources) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResources(response, &metadata) + } + output := &UntagResourcesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUntagResourcesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUntagResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsAwsjson11_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_deserializeErrorConcurrentModificationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ConcurrentModificationException{} + err := awsAwsjson11_deserializeDocumentConcurrentModificationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorConstraintViolationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ConstraintViolationException{} + err := awsAwsjson11_deserializeDocumentConstraintViolationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInternalServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InternalServiceException{} + err := awsAwsjson11_deserializeDocumentInternalServiceException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidParameterException{} + err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorPaginationTokenExpiredException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.PaginationTokenExpiredException{} + err := awsAwsjson11_deserializeDocumentPaginationTokenExpiredException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorThrottledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottledException{} + err := awsAwsjson11_deserializeDocumentThrottledException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeDocumentComplianceDetails(v **types.ComplianceDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComplianceDetails + if *v == nil { + sv = &types.ComplianceDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ComplianceStatus": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected ComplianceStatus to be of type *bool, got %T instead", value) + } + sv.ComplianceStatus = ptr.Bool(jtv) + } + + case "KeysWithNoncompliantValues": + if err := awsAwsjson11_deserializeDocumentTagKeyList(&sv.KeysWithNoncompliantValues, value); err != nil { + return err + } + + case "NoncompliantKeys": + if err := awsAwsjson11_deserializeDocumentTagKeyList(&sv.NoncompliantKeys, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentConcurrentModificationException(v **types.ConcurrentModificationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConcurrentModificationException + if *v == nil { + sv = &types.ConcurrentModificationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentConstraintViolationException(v **types.ConstraintViolationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConstraintViolationException + if *v == nil { + sv = &types.ConstraintViolationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFailedResourcesMap(v *map[string]types.FailureInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]types.FailureInfo + if *v == nil { + mv = map[string]types.FailureInfo{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.FailureInfo + mapVar := parsedVal + destAddr := &mapVar + if err := awsAwsjson11_deserializeDocumentFailureInfo(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsAwsjson11_deserializeDocumentFailureInfo(v **types.FailureInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FailureInfo + if *v == nil { + sv = &types.FailureInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.ErrorCode(jtv) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "StatusCode": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected StatusCode to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StatusCode = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentInternalServiceException(v **types.InternalServiceException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServiceException + if *v == nil { + sv = &types.InternalServiceException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidParameterException + if *v == nil { + sv = &types.InvalidParameterException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPaginationTokenExpiredException(v **types.PaginationTokenExpiredException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PaginationTokenExpiredException + if *v == nil { + sv = &types.PaginationTokenExpiredException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceTagMapping(v **types.ResourceTagMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceTagMapping + if *v == nil { + sv = &types.ResourceTagMapping{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ComplianceDetails": + if err := awsAwsjson11_deserializeDocumentComplianceDetails(&sv.ComplianceDetails, value); err != nil { + return err + } + + case "ResourceARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value) + } + sv.ResourceARN = ptr.String(jtv) + } + + case "Tags": + if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceTagMappingList(v *[]types.ResourceTagMapping, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ResourceTagMapping + if *v == nil { + cv = []types.ResourceTagMapping{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourceTagMapping + destAddr := &col + if err := awsAwsjson11_deserializeDocumentResourceTagMapping(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentSummary(v **types.Summary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Summary + if *v == nil { + sv = &types.Summary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LastUpdated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LastUpdated to be of type string, got %T instead", value) + } + sv.LastUpdated = ptr.String(jtv) + } + + case "NonCompliantResources": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NonCompliantResources to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NonCompliantResources = i64 + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Region to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "TargetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetId to be of type string, got %T instead", value) + } + sv.TargetId = ptr.String(jtv) + } + + case "TargetIdType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetIdType to be of type string, got %T instead", value) + } + sv.TargetIdType = types.TargetIdType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSummaryList(v *[]types.Summary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Summary + if *v == nil { + cv = []types.Summary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Summary + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTagKeyList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentTagValuesOutputList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentThrottledException(v **types.ThrottledException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottledException + if *v == nil { + sv = &types.ThrottledException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDescribeReportCreationOutput(v **DescribeReportCreationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeReportCreationOutput + if *v == nil { + sv = &DescribeReportCreationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "S3Location": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3Location to be of type string, got %T instead", value) + } + sv.S3Location = ptr.String(jtv) + } + + case "StartDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StartDate to be of type string, got %T instead", value) + } + sv.StartDate = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Status to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetComplianceSummaryOutput(v **GetComplianceSummaryOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetComplianceSummaryOutput + if *v == nil { + sv = &GetComplianceSummaryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PaginationToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.PaginationToken = ptr.String(jtv) + } + + case "SummaryList": + if err := awsAwsjson11_deserializeDocumentSummaryList(&sv.SummaryList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetResourcesOutput(v **GetResourcesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetResourcesOutput + if *v == nil { + sv = &GetResourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PaginationToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.PaginationToken = ptr.String(jtv) + } + + case "ResourceTagMappingList": + if err := awsAwsjson11_deserializeDocumentResourceTagMappingList(&sv.ResourceTagMappingList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetTagKeysOutput(v **GetTagKeysOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTagKeysOutput + if *v == nil { + sv = &GetTagKeysOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PaginationToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.PaginationToken = ptr.String(jtv) + } + + case "TagKeys": + if err := awsAwsjson11_deserializeDocumentTagKeyList(&sv.TagKeys, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetTagValuesOutput(v **GetTagValuesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTagValuesOutput + if *v == nil { + sv = &GetTagValuesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PaginationToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.PaginationToken = ptr.String(jtv) + } + + case "TagValues": + if err := awsAwsjson11_deserializeDocumentTagValuesOutputList(&sv.TagValues, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentStartReportCreationOutput(v **StartReportCreationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartReportCreationOutput + if *v == nil { + sv = &StartReportCreationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentTagResourcesOutput(v **TagResourcesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *TagResourcesOutput + if *v == nil { + sv = &TagResourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FailedResourcesMap": + if err := awsAwsjson11_deserializeDocumentFailedResourcesMap(&sv.FailedResourcesMap, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUntagResourcesOutput(v **UntagResourcesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UntagResourcesOutput + if *v == nil { + sv = &UntagResourcesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FailedResourcesMap": + if err := awsAwsjson11_deserializeDocumentFailedResourcesMap(&sv.FailedResourcesMap, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type protocolErrorInfo struct { + Type string `json:"__type"` + Message string + Code any // nonstandard for awsjson but some services do present the type here +} + +func getProtocolErrorInfo(decoder *json.Decoder) (protocolErrorInfo, error) { + var errInfo protocolErrorInfo + if err := decoder.Decode(&errInfo); err != nil { + if err == io.EOF { + return errInfo, nil + } + return errInfo, err + } + + return errInfo, nil +} + +func resolveProtocolErrorType(headerType string, bodyInfo protocolErrorInfo) (string, bool) { + if len(headerType) != 0 { + return headerType, true + } else if len(bodyInfo.Type) != 0 { + return bodyInfo.Type, true + } else if code, ok := bodyInfo.Code.(string); ok && len(code) != 0 { + return code, true + } + return "", false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/doc.go new file mode 100644 index 000000000..8a7fb0f85 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/doc.go @@ -0,0 +1,7 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package resourcegroupstaggingapi provides the API client, operations, and +// parameter types for AWS Resource Groups Tagging API. +// +// Resource Groups Tagging API +package resourcegroupstaggingapi diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/endpoints.go new file mode 100644 index 000000000..d9550916a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/endpoints.go @@ -0,0 +1,537 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "tagging" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_RESOURCE_GROUPS_TAGGING_API") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Resource Groups Tagging API", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://tagging-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if true == _PartitionResult.SupportsFIPS { + uriString := func() string { + var out strings.Builder + out.WriteString("https://tagging-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://tagging.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://tagging.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/generated.json new file mode 100644 index 000000000..f08824bce --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/generated.json @@ -0,0 +1,41 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_DescribeReportCreation.go", + "api_op_GetComplianceSummary.go", + "api_op_GetResources.go", + "api_op_GetTagKeys.go", + "api_op_GetTagValues.go", + "api_op_StartReportCreation.go", + "api_op_TagResources.go", + "api_op_UntagResources.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "sra_operation_order_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.22", + "module": "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/go_module_metadata.go new file mode 100644 index 000000000..bb7d65895 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package resourcegroupstaggingapi + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.26.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/internal/endpoints/endpoints.go new file mode 100644 index 000000000..f10fa5bc4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/internal/endpoints/endpoints.go @@ -0,0 +1,459 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver Resource Groups Tagging API endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsEusc *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "tagging.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tagging-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "tagging-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tagging.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-7", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "mx-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "tagging.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tagging-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "tagging-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tagging.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-eusc", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tagging-fips.{region}.amazonaws.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tagging.{region}.amazonaws.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsEusc, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tagging-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tagging.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tagging-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tagging.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tagging-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tagging.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "eu-isoe-west-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tagging-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tagging.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isof-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isof-south-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "tagging.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "tagging-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "tagging-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "tagging.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/options.go new file mode 100644 index 000000000..fd59525a8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/serializers.go new file mode 100644 index 000000000..438c22646 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/serializers.go @@ -0,0 +1,841 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "path" +) + +type awsAwsjson11_serializeOpDescribeReportCreation struct { +} + +func (*awsAwsjson11_serializeOpDescribeReportCreation) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeReportCreation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeReportCreationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ResourceGroupsTaggingAPI_20170126.DescribeReportCreation") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeReportCreationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpGetComplianceSummary struct { +} + +func (*awsAwsjson11_serializeOpGetComplianceSummary) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetComplianceSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetComplianceSummaryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ResourceGroupsTaggingAPI_20170126.GetComplianceSummary") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetComplianceSummaryInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpGetResources struct { +} + +func (*awsAwsjson11_serializeOpGetResources) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetResourcesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ResourceGroupsTaggingAPI_20170126.GetResources") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetResourcesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpGetTagKeys struct { +} + +func (*awsAwsjson11_serializeOpGetTagKeys) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetTagKeys) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetTagKeysInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ResourceGroupsTaggingAPI_20170126.GetTagKeys") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetTagKeysInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpGetTagValues struct { +} + +func (*awsAwsjson11_serializeOpGetTagValues) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetTagValues) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetTagValuesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ResourceGroupsTaggingAPI_20170126.GetTagValues") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetTagValuesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpStartReportCreation struct { +} + +func (*awsAwsjson11_serializeOpStartReportCreation) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpStartReportCreation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartReportCreationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ResourceGroupsTaggingAPI_20170126.StartReportCreation") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentStartReportCreationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpTagResources struct { +} + +func (*awsAwsjson11_serializeOpTagResources) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpTagResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourcesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ResourceGroupsTaggingAPI_20170126.TagResources") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentTagResourcesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUntagResources struct { +} + +func (*awsAwsjson11_serializeOpUntagResources) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUntagResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourcesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ResourceGroupsTaggingAPI_20170126.UntagResources") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUntagResourcesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsAwsjson11_serializeDocumentGroupBy(v []types.GroupByAttribute, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsAwsjson11_serializeDocumentRegionFilterList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentResourceARNListForGet(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentResourceARNListForTagUntag(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentResourceTypeFilterList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTagFilter(v *types.TagFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsAwsjson11_serializeDocumentTagValueList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentTagFilterList(v []types.TagFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentTagFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentTagKeyFilterList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTagKeyListForUntag(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTagValueList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTargetIdFilterList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeOpDocumentDescribeReportCreationInput(v *DescribeReportCreationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetComplianceSummaryInput(v *GetComplianceSummaryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GroupBy != nil { + ok := object.Key("GroupBy") + if err := awsAwsjson11_serializeDocumentGroupBy(v.GroupBy, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.PaginationToken != nil { + ok := object.Key("PaginationToken") + ok.String(*v.PaginationToken) + } + + if v.RegionFilters != nil { + ok := object.Key("RegionFilters") + if err := awsAwsjson11_serializeDocumentRegionFilterList(v.RegionFilters, ok); err != nil { + return err + } + } + + if v.ResourceTypeFilters != nil { + ok := object.Key("ResourceTypeFilters") + if err := awsAwsjson11_serializeDocumentResourceTypeFilterList(v.ResourceTypeFilters, ok); err != nil { + return err + } + } + + if v.TagKeyFilters != nil { + ok := object.Key("TagKeyFilters") + if err := awsAwsjson11_serializeDocumentTagKeyFilterList(v.TagKeyFilters, ok); err != nil { + return err + } + } + + if v.TargetIdFilters != nil { + ok := object.Key("TargetIdFilters") + if err := awsAwsjson11_serializeDocumentTargetIdFilterList(v.TargetIdFilters, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetResourcesInput(v *GetResourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExcludeCompliantResources != nil { + ok := object.Key("ExcludeCompliantResources") + ok.Boolean(*v.ExcludeCompliantResources) + } + + if v.IncludeComplianceDetails != nil { + ok := object.Key("IncludeComplianceDetails") + ok.Boolean(*v.IncludeComplianceDetails) + } + + if v.PaginationToken != nil { + ok := object.Key("PaginationToken") + ok.String(*v.PaginationToken) + } + + if v.ResourceARNList != nil { + ok := object.Key("ResourceARNList") + if err := awsAwsjson11_serializeDocumentResourceARNListForGet(v.ResourceARNList, ok); err != nil { + return err + } + } + + if v.ResourcesPerPage != nil { + ok := object.Key("ResourcesPerPage") + ok.Integer(*v.ResourcesPerPage) + } + + if v.ResourceTypeFilters != nil { + ok := object.Key("ResourceTypeFilters") + if err := awsAwsjson11_serializeDocumentResourceTypeFilterList(v.ResourceTypeFilters, ok); err != nil { + return err + } + } + + if v.TagFilters != nil { + ok := object.Key("TagFilters") + if err := awsAwsjson11_serializeDocumentTagFilterList(v.TagFilters, ok); err != nil { + return err + } + } + + if v.TagsPerPage != nil { + ok := object.Key("TagsPerPage") + ok.Integer(*v.TagsPerPage) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetTagKeysInput(v *GetTagKeysInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PaginationToken != nil { + ok := object.Key("PaginationToken") + ok.String(*v.PaginationToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetTagValuesInput(v *GetTagValuesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.PaginationToken != nil { + ok := object.Key("PaginationToken") + ok.String(*v.PaginationToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentStartReportCreationInput(v *StartReportCreationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3Bucket != nil { + ok := object.Key("S3Bucket") + ok.String(*v.S3Bucket) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentTagResourcesInput(v *TagResourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARNList != nil { + ok := object.Key("ResourceARNList") + if err := awsAwsjson11_serializeDocumentResourceARNListForTagUntag(v.ResourceARNList, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUntagResourcesInput(v *UntagResourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARNList != nil { + ok := object.Key("ResourceARNList") + if err := awsAwsjson11_serializeDocumentResourceARNListForTagUntag(v.ResourceARNList, ok); err != nil { + return err + } + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsAwsjson11_serializeDocumentTagKeyListForUntag(v.TagKeys, ok); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types/enums.go new file mode 100644 index 000000000..3656674ed --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types/enums.go @@ -0,0 +1,64 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type ErrorCode string + +// Enum values for ErrorCode +const ( + ErrorCodeInternalServiceException ErrorCode = "InternalServiceException" + ErrorCodeInvalidParameterException ErrorCode = "InvalidParameterException" +) + +// Values returns all known values for ErrorCode. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ErrorCode) Values() []ErrorCode { + return []ErrorCode{ + "InternalServiceException", + "InvalidParameterException", + } +} + +type GroupByAttribute string + +// Enum values for GroupByAttribute +const ( + GroupByAttributeTargetId GroupByAttribute = "TARGET_ID" + GroupByAttributeRegion GroupByAttribute = "REGION" + GroupByAttributeResourceType GroupByAttribute = "RESOURCE_TYPE" +) + +// Values returns all known values for GroupByAttribute. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (GroupByAttribute) Values() []GroupByAttribute { + return []GroupByAttribute{ + "TARGET_ID", + "REGION", + "RESOURCE_TYPE", + } +} + +type TargetIdType string + +// Enum values for TargetIdType +const ( + TargetIdTypeAccount TargetIdType = "ACCOUNT" + TargetIdTypeOu TargetIdType = "OU" + TargetIdTypeRoot TargetIdType = "ROOT" +) + +// Values returns all known values for TargetIdType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TargetIdType) Values() []TargetIdType { + return []TargetIdType{ + "ACCOUNT", + "OU", + "ROOT", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types/errors.go new file mode 100644 index 000000000..145310c41 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types/errors.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The target of the operation is currently being modified by a different request. +// Try again later. +type ConcurrentModificationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConcurrentModificationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConcurrentModificationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConcurrentModificationException" + } + return *e.ErrorCodeOverride +} +func (e *ConcurrentModificationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied because performing this operation violates a constraint. +// +// Some of the reasons in the following list might not apply to this specific +// operation. +// +// - You must meet the prerequisites for using tag policies. For information, +// see [Prerequisites and Permissions for Using Tag Policies]in the Organizations User Guide. +// +// - You must enable the tag policies service principal ( +// tagpolicies.tag.amazonaws.com ) to integrate with Organizations For +// information, see [EnableAWSServiceAccess]. +// +// - You must have a tag policy attached to the organization root, an OU, or an +// account. +// +// [EnableAWSServiceAccess]: https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html +// [Prerequisites and Permissions for Using Tag Policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html +type ConstraintViolationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ConstraintViolationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConstraintViolationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConstraintViolationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConstraintViolationException" + } + return *e.ErrorCodeOverride +} +func (e *ConstraintViolationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request processing failed because of an unknown error, exception, or +// failure. You can retry the request. +type InternalServiceException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServiceException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServiceException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServiceException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// This error indicates one of the following: +// +// - A parameter is missing. +// +// - A malformed string was supplied for the request parameter. +// +// - An out-of-range value was supplied for the request parameter. +// +// - The target ID is invalid, unsupported, or doesn't exist. +// +// - You can't access the Amazon S3 bucket for report storage. For more +// information, see [Additional Requirements for Organization-wide Tag Compliance Reports]in the Organizations User Guide. +// +// [Additional Requirements for Organization-wide Tag Compliance Reports]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report +type InvalidParameterException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidParameterException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidParameterException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidParameterException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A PaginationToken is valid for a maximum of 15 minutes. Your request was denied +// because the specified PaginationToken has expired. +type PaginationTokenExpiredException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *PaginationTokenExpiredException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *PaginationTokenExpiredException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *PaginationTokenExpiredException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PaginationTokenExpiredException" + } + return *e.ErrorCodeOverride +} +func (e *PaginationTokenExpiredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied to limit the frequency of submitted requests. +type ThrottledException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ThrottledException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottledException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottledException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottledException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types/types.go new file mode 100644 index 000000000..399a079a5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types/types.go @@ -0,0 +1,150 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// Information that shows whether a resource is compliant with the effective tag +// policy, including details on any noncompliant tag keys. +type ComplianceDetails struct { + + // Whether a resource is compliant with the effective tag policy. + ComplianceStatus *bool + + // These are keys defined in the effective policy that are on the resource with + // either incorrect case treatment or noncompliant values. + KeysWithNoncompliantValues []string + + // These tag keys on the resource are noncompliant with the effective tag policy. + NoncompliantKeys []string + + noSmithyDocumentSerde +} + +// Information about the errors that are returned for each failed resource. This +// information can include InternalServiceException and InvalidParameterException +// errors. It can also include any valid error code returned by the Amazon Web +// Services service that hosts the resource that the ARN key represents. +// +// The following are common error codes that you might receive from other Amazon +// Web Services services: +// +// - InternalServiceException – This can mean that the Resource Groups Tagging +// API didn't receive a response from another Amazon Web Services service. It can +// also mean that the resource type in the request is not supported by the Resource +// Groups Tagging API. In these cases, it's safe to retry the request and then call +// [GetResources]to verify the changes. +// +// - AccessDeniedException – This can mean that you need permission to call the +// tagging operations in the Amazon Web Services service that contains the +// resource. For example, to use the Resource Groups Tagging API to tag a Amazon +// CloudWatch alarm resource, you need permission to call both [TagResources]TagResources and [TagResource] +// TagResource in the CloudWatch API. +// +// For more information on errors that are generated from other Amazon Web +// Services services, see the documentation for that service. +// +// [TagResource]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html +// [TagResources]: https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_TagResources.html +// [GetResources]: https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html +type FailureInfo struct { + + // The code of the common error. Valid values include InternalServiceException , + // InvalidParameterException , and any valid error code returned by the Amazon Web + // Services service that hosts the resource that you want to tag. + ErrorCode ErrorCode + + // The message of the common error. + ErrorMessage *string + + // The HTTP status code of the common error. + StatusCode int32 + + noSmithyDocumentSerde +} + +// A list of resource ARNs and the tags (keys and values) that are associated with +// each. +type ResourceTagMapping struct { + + // Information that shows whether a resource is compliant with the effective tag + // policy, including details on any noncompliant tag keys. + ComplianceDetails *ComplianceDetails + + // The ARN of the resource. + ResourceARN *string + + // The tags that have been applied to one or more Amazon Web Services resources. + Tags []Tag + + noSmithyDocumentSerde +} + +// A count of noncompliant resources. +type Summary struct { + + // The timestamp that shows when this summary was generated in this Region. + LastUpdated *string + + // The count of noncompliant resources. + NonCompliantResources int64 + + // The Amazon Web Services Region that the summary applies to. + Region *string + + // The Amazon Web Services resource type. + ResourceType *string + + // The account identifier or the root identifier of the organization. If you don't + // know the root ID, you can call the Organizations [ListRoots]API. + // + // [ListRoots]: https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListRoots.html + TargetId *string + + // Whether the target is an account, an OU, or the organization root. + TargetIdType TargetIdType + + noSmithyDocumentSerde +} + +// The metadata that you apply to Amazon Web Services resources to help you +// categorize and organize them. Each tag consists of a key and a value, both of +// which you define. For more information, see [Tagging Amazon Web Services Resources]in the Amazon Web Services General +// Reference. +// +// [Tagging Amazon Web Services Resources]: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html +type Tag struct { + + // One part of a key-value pair that makes up a tag. A key is a general label that + // acts like a category for more specific tag values. + // + // This member is required. + Key *string + + // One part of a key-value pair that make up a tag. A value acts as a descriptor + // within a tag category (key). The value can be empty or null. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// A list of tags (keys and values) that are used to specify the associated +// resources. +type TagFilter struct { + + // One part of a key-value pair that makes up a tag. A key is a general label that + // acts like a category for more specific tag values. + Key *string + + // One part of a key-value pair that make up a tag. A value acts as a descriptor + // within a tag category (key). The value can be empty or null. + Values []string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/validators.go new file mode 100644 index 000000000..88c40c8f9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/validators.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpGetTagValues struct { +} + +func (*validateOpGetTagValues) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTagValues) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTagValuesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTagValuesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartReportCreation struct { +} + +func (*validateOpStartReportCreation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartReportCreation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartReportCreationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartReportCreationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResources struct { +} + +func (*validateOpTagResources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResources struct { +} + +func (*validateOpUntagResources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpGetTagValuesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTagValues{}, middleware.After) +} + +func addOpStartReportCreationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartReportCreation{}, middleware.After) +} + +func addOpTagResourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResources{}, middleware.After) +} + +func addOpUntagResourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResources{}, middleware.After) +} + +func validateOpGetTagValuesInput(v *GetTagValuesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTagValuesInput"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartReportCreationInput(v *StartReportCreationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartReportCreationInput"} + if v.S3Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Bucket")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourcesInput(v *TagResourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourcesInput"} + if v.ResourceARNList == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARNList")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourcesInput(v *UntagResourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourcesInput"} + if v.ResourceARNList == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceARNList")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/doc.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/doc.go new file mode 100644 index 000000000..66697bada --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/doc.go @@ -0,0 +1,2 @@ +// A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources. +package aws diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getArn.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getArn.go new file mode 100644 index 000000000..8201ea41e --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getArn.go @@ -0,0 +1,148 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Parses an ARN into its constituent parts. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetArn(ctx, &aws.GetArnArgs{ +// Arn: "arn:aws:rds:eu-west-1:123456789012:db:mysql-db", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetArn(ctx *pulumi.Context, args *GetArnArgs, opts ...pulumi.InvokeOption) (*GetArnResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetArnResult + err := ctx.Invoke("aws:index/getArn:getArn", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getArn. +type GetArnArgs struct { + // ARN to parse. + Arn string `pulumi:"arn"` + Id *string `pulumi:"id"` +} + +// A collection of values returned by getArn. +type GetArnResult struct { + // The [ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) of the AWS account that owns the resource, without the hyphens. + Account string `pulumi:"account"` + Arn string `pulumi:"arn"` + Id string `pulumi:"id"` + // Partition that the resource is in. + Partition string `pulumi:"partition"` + // Region the resource resides in. + // Note that the ARNs for some resources do not require a region, so this component might be omitted. + Region string `pulumi:"region"` + // Content of this part of the ARN varies by service. + // It often includes an indicator of the type of resource—for example, an IAM user or Amazon RDS database —followed by a slash (/) or a colon (:), followed by the resource name itself. + Resource string `pulumi:"resource"` + // The [service namespace](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) that identifies the AWS product. + Service string `pulumi:"service"` +} + +func GetArnOutput(ctx *pulumi.Context, args GetArnOutputArgs, opts ...pulumi.InvokeOption) GetArnResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetArnResultOutput, error) { + args := v.(GetArnArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getArn:getArn", args, GetArnResultOutput{}, options).(GetArnResultOutput), nil + }).(GetArnResultOutput) +} + +// A collection of arguments for invoking getArn. +type GetArnOutputArgs struct { + // ARN to parse. + Arn pulumi.StringInput `pulumi:"arn"` + Id pulumi.StringPtrInput `pulumi:"id"` +} + +func (GetArnOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetArnArgs)(nil)).Elem() +} + +// A collection of values returned by getArn. +type GetArnResultOutput struct{ *pulumi.OutputState } + +func (GetArnResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetArnResult)(nil)).Elem() +} + +func (o GetArnResultOutput) ToGetArnResultOutput() GetArnResultOutput { + return o +} + +func (o GetArnResultOutput) ToGetArnResultOutputWithContext(ctx context.Context) GetArnResultOutput { + return o +} + +// The [ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) of the AWS account that owns the resource, without the hyphens. +func (o GetArnResultOutput) Account() pulumi.StringOutput { + return o.ApplyT(func(v GetArnResult) string { return v.Account }).(pulumi.StringOutput) +} + +func (o GetArnResultOutput) Arn() pulumi.StringOutput { + return o.ApplyT(func(v GetArnResult) string { return v.Arn }).(pulumi.StringOutput) +} + +func (o GetArnResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetArnResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Partition that the resource is in. +func (o GetArnResultOutput) Partition() pulumi.StringOutput { + return o.ApplyT(func(v GetArnResult) string { return v.Partition }).(pulumi.StringOutput) +} + +// Region the resource resides in. +// Note that the ARNs for some resources do not require a region, so this component might be omitted. +func (o GetArnResultOutput) Region() pulumi.StringOutput { + return o.ApplyT(func(v GetArnResult) string { return v.Region }).(pulumi.StringOutput) +} + +// Content of this part of the ARN varies by service. +// It often includes an indicator of the type of resource—for example, an IAM user or Amazon RDS database —followed by a slash (/) or a colon (:), followed by the resource name itself. +func (o GetArnResultOutput) Resource() pulumi.StringOutput { + return o.ApplyT(func(v GetArnResult) string { return v.Resource }).(pulumi.StringOutput) +} + +// The [service namespace](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces) that identifies the AWS product. +func (o GetArnResultOutput) Service() pulumi.StringOutput { + return o.ApplyT(func(v GetArnResult) string { return v.Service }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterOutputType(GetArnResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getAvailabilityZone.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getAvailabilityZone.go new file mode 100644 index 000000000..38f30d478 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getAvailabilityZone.go @@ -0,0 +1,280 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// `getAvailabilityZone` provides details about a specific availability zone (AZ) +// in the current region. +// +// This can be used both to validate an availability zone given in a variable +// and to split the AZ name into its component parts of an AWS region and an +// AZ identifier letter. The latter may be useful e.g., for implementing a +// consistent subnet numbering scheme across several regions by mapping both +// the region and the subnet letter to network numbers. +// +// This is different from the `getAvailabilityZones` (plural) data source, +// which provides a list of the available zones. +// +// ## Example Usage +// +// The following example shows how this data source might be used to derive +// VPC and subnet CIDR prefixes systematically for an availability zone. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" +// "github.com/pulumi/pulumi-std/sdk/go/std" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// cfg := config.New(ctx, "") +// regionNumber := map[string]interface{}{ +// "ap-northeast-1": 5, +// "eu-central-1": 4, +// "us-east-1": 1, +// "us-west-1": 2, +// "us-west-2": 3, +// } +// if param := cfg.GetObject("regionNumber"); param != nil { +// regionNumber = param +// } +// azNumber := map[string]interface{}{ +// "a": 1, +// "b": 2, +// "c": 3, +// "d": 4, +// "e": 5, +// "f": 6, +// } +// if param := cfg.GetObject("azNumber"); param != nil { +// azNumber = param +// } +// // Retrieve the AZ where we want to create network resources +// // This must be in the region selected on the AWS provider. +// example, err := aws.GetAvailabilityZone(ctx, &aws.GetAvailabilityZoneArgs{ +// Name: pulumi.StringRef("eu-central-1a"), +// }, nil) +// if err != nil { +// return err +// } +// invokeCidrsubnet, err := std.Cidrsubnet(ctx, &std.CidrsubnetArgs{ +// Input: "10.0.0.0/8", +// Newbits: 4, +// Netnum: regionNumber[example.Region], +// }, nil) +// if err != nil { +// return err +// } +// // Create a VPC for the region associated with the AZ +// exampleVpc, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{ +// CidrBlock: pulumi.String(invokeCidrsubnet.Result), +// }) +// if err != nil { +// return err +// } +// invokeCidrsubnet1, err := std.Cidrsubnet(ctx, &std.CidrsubnetArgs{ +// Input: cidrBlock, +// Newbits: 4, +// Netnum: pulumi.Int(azNumber[example.NameSuffix]), +// }, nil) +// if err != nil { +// return err +// } +// // Create a subnet for the AZ within the regional VPC +// _, err = ec2.NewSubnet(ctx, "example", &ec2.SubnetArgs{ +// VpcId: exampleVpc.ID(), +// CidrBlock: pulumi.String(exampleVpc.CidrBlock.ApplyT(func(cidrBlock string) (std.CidrsubnetResult, error) { +// return std.CidrsubnetResult(invokeCidrsubnet1), nil +// }).(std.CidrsubnetResultOutput).ApplyT(func(invoke std.CidrsubnetResult) (*string, error) { +// return invoke.Result, nil +// }).(pulumi.StringPtrOutput)), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetAvailabilityZone(ctx *pulumi.Context, args *GetAvailabilityZoneArgs, opts ...pulumi.InvokeOption) (*GetAvailabilityZoneResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetAvailabilityZoneResult + err := ctx.Invoke("aws:index/getAvailabilityZone:getAvailabilityZone", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getAvailabilityZone. +type GetAvailabilityZoneArgs struct { + // Set to `true` to include all Availability Zones and Local Zones regardless of your opt in status. + AllAvailabilityZones *bool `pulumi:"allAvailabilityZones"` + // Configuration block(s) for filtering. Detailed below. + Filters []GetAvailabilityZoneFilter `pulumi:"filters"` + // Full name of the availability zone to select. + Name *string `pulumi:"name"` + // Specific availability zone state to require. May be any of `"available"`, `"information"` or `"impaired"`. + State *string `pulumi:"state"` + // Zone ID of the availability zone to select. + ZoneId *string `pulumi:"zoneId"` +} + +// A collection of values returned by getAvailabilityZone. +type GetAvailabilityZoneResult struct { + AllAvailabilityZones *bool `pulumi:"allAvailabilityZones"` + Filters []GetAvailabilityZoneFilter `pulumi:"filters"` + // For Availability Zones, this is the same value as the Region name. For Local Zones, the name of the associated group, for example `us-west-2-lax-1`. + GroupName string `pulumi:"groupName"` + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + Name string `pulumi:"name"` + // Part of the AZ name that appears after the region name, uniquely identifying the AZ within its region. + // For Availability Zones this is usually a single letter, for example `a` for the `us-west-2a` zone. + // For Local and Wavelength Zones this is a longer string, for example `wl1-sfo-wlz-1` for the `us-west-2-wl1-sfo-wlz-1` zone. + NameSuffix string `pulumi:"nameSuffix"` + // The name of the location from which the address is advertised. + NetworkBorderGroup string `pulumi:"networkBorderGroup"` + // For Availability Zones, this always has the value of `opt-in-not-required`. For Local Zones, this is the opt in status. The possible values are `opted-in` and `not-opted-in`. + OptInStatus string `pulumi:"optInStatus"` + // ID of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls. + ParentZoneId string `pulumi:"parentZoneId"` + // Name of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls. + ParentZoneName string `pulumi:"parentZoneName"` + // Region where the selected availability zone resides. This is always the region selected on the provider, since this data source searches only within that region. + Region string `pulumi:"region"` + State string `pulumi:"state"` + ZoneId string `pulumi:"zoneId"` + // Type of zone. Values are `availability-zone`, `local-zone`, and `wavelength-zone`. + ZoneType string `pulumi:"zoneType"` +} + +func GetAvailabilityZoneOutput(ctx *pulumi.Context, args GetAvailabilityZoneOutputArgs, opts ...pulumi.InvokeOption) GetAvailabilityZoneResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetAvailabilityZoneResultOutput, error) { + args := v.(GetAvailabilityZoneArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getAvailabilityZone:getAvailabilityZone", args, GetAvailabilityZoneResultOutput{}, options).(GetAvailabilityZoneResultOutput), nil + }).(GetAvailabilityZoneResultOutput) +} + +// A collection of arguments for invoking getAvailabilityZone. +type GetAvailabilityZoneOutputArgs struct { + // Set to `true` to include all Availability Zones and Local Zones regardless of your opt in status. + AllAvailabilityZones pulumi.BoolPtrInput `pulumi:"allAvailabilityZones"` + // Configuration block(s) for filtering. Detailed below. + Filters GetAvailabilityZoneFilterArrayInput `pulumi:"filters"` + // Full name of the availability zone to select. + Name pulumi.StringPtrInput `pulumi:"name"` + // Specific availability zone state to require. May be any of `"available"`, `"information"` or `"impaired"`. + State pulumi.StringPtrInput `pulumi:"state"` + // Zone ID of the availability zone to select. + ZoneId pulumi.StringPtrInput `pulumi:"zoneId"` +} + +func (GetAvailabilityZoneOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetAvailabilityZoneArgs)(nil)).Elem() +} + +// A collection of values returned by getAvailabilityZone. +type GetAvailabilityZoneResultOutput struct{ *pulumi.OutputState } + +func (GetAvailabilityZoneResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetAvailabilityZoneResult)(nil)).Elem() +} + +func (o GetAvailabilityZoneResultOutput) ToGetAvailabilityZoneResultOutput() GetAvailabilityZoneResultOutput { + return o +} + +func (o GetAvailabilityZoneResultOutput) ToGetAvailabilityZoneResultOutputWithContext(ctx context.Context) GetAvailabilityZoneResultOutput { + return o +} + +func (o GetAvailabilityZoneResultOutput) AllAvailabilityZones() pulumi.BoolPtrOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) *bool { return v.AllAvailabilityZones }).(pulumi.BoolPtrOutput) +} + +func (o GetAvailabilityZoneResultOutput) Filters() GetAvailabilityZoneFilterArrayOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) []GetAvailabilityZoneFilter { return v.Filters }).(GetAvailabilityZoneFilterArrayOutput) +} + +// For Availability Zones, this is the same value as the Region name. For Local Zones, the name of the associated group, for example `us-west-2-lax-1`. +func (o GetAvailabilityZoneResultOutput) GroupName() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.GroupName }).(pulumi.StringOutput) +} + +// The provider-assigned unique ID for this managed resource. +func (o GetAvailabilityZoneResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.Id }).(pulumi.StringOutput) +} + +func (o GetAvailabilityZoneResultOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.Name }).(pulumi.StringOutput) +} + +// Part of the AZ name that appears after the region name, uniquely identifying the AZ within its region. +// For Availability Zones this is usually a single letter, for example `a` for the `us-west-2a` zone. +// For Local and Wavelength Zones this is a longer string, for example `wl1-sfo-wlz-1` for the `us-west-2-wl1-sfo-wlz-1` zone. +func (o GetAvailabilityZoneResultOutput) NameSuffix() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.NameSuffix }).(pulumi.StringOutput) +} + +// The name of the location from which the address is advertised. +func (o GetAvailabilityZoneResultOutput) NetworkBorderGroup() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.NetworkBorderGroup }).(pulumi.StringOutput) +} + +// For Availability Zones, this always has the value of `opt-in-not-required`. For Local Zones, this is the opt in status. The possible values are `opted-in` and `not-opted-in`. +func (o GetAvailabilityZoneResultOutput) OptInStatus() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.OptInStatus }).(pulumi.StringOutput) +} + +// ID of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls. +func (o GetAvailabilityZoneResultOutput) ParentZoneId() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.ParentZoneId }).(pulumi.StringOutput) +} + +// Name of the zone that handles some of the Local Zone or Wavelength Zone control plane operations, such as API calls. +func (o GetAvailabilityZoneResultOutput) ParentZoneName() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.ParentZoneName }).(pulumi.StringOutput) +} + +// Region where the selected availability zone resides. This is always the region selected on the provider, since this data source searches only within that region. +func (o GetAvailabilityZoneResultOutput) Region() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.Region }).(pulumi.StringOutput) +} + +func (o GetAvailabilityZoneResultOutput) State() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.State }).(pulumi.StringOutput) +} + +func (o GetAvailabilityZoneResultOutput) ZoneId() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.ZoneId }).(pulumi.StringOutput) +} + +// Type of zone. Values are `availability-zone`, `local-zone`, and `wavelength-zone`. +func (o GetAvailabilityZoneResultOutput) ZoneType() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneResult) string { return v.ZoneType }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterOutputType(GetAvailabilityZoneResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getAvailabilityZones.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getAvailabilityZones.go new file mode 100644 index 000000000..0ded07e34 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getAvailabilityZones.go @@ -0,0 +1,266 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// The Availability Zones data source allows access to the list of AWS +// Availability Zones which can be accessed by an AWS account within the region +// configured in the provider. +// +// This is different from the `getAvailabilityZone` (singular) data source, +// which provides some details about a specific availability zone. +// +// > When [Local Zones](https://aws.amazon.com/about-aws/global-infrastructure/localzones/) are enabled in a region, by default the API and this data source include both Local Zones and Availability Zones. To return only Availability Zones, see the example section below. +// +// ## Example Usage +// +// ### By State +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// // Declare the data source +// available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{ +// State: pulumi.StringRef("available"), +// }, nil) +// if err != nil { +// return err +// } +// // e.g., Create subnets in the first two available availability zones +// _, err = ec2.NewSubnet(ctx, "primary", &ec2.SubnetArgs{ +// AvailabilityZone: pulumi.String(available.Names[0]), +// }) +// if err != nil { +// return err +// } +// _, err = ec2.NewSubnet(ctx, "secondary", &ec2.SubnetArgs{ +// AvailabilityZone: pulumi.String(available.Names[1]), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ### By Filter +// +// All Local Zones (regardless of opt-in status): +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{ +// AllAvailabilityZones: pulumi.BoolRef(true), +// Filters: []aws.GetAvailabilityZonesFilter{ +// { +// Name: "opt-in-status", +// Values: []string{ +// "not-opted-in", +// "opted-in", +// }, +// }, +// }, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// Only Availability Zones (no Local Zones): +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{ +// Filters: []aws.GetAvailabilityZonesFilter{ +// { +// Name: "opt-in-status", +// Values: []string{ +// "opt-in-not-required", +// }, +// }, +// }, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetAvailabilityZones(ctx *pulumi.Context, args *GetAvailabilityZonesArgs, opts ...pulumi.InvokeOption) (*GetAvailabilityZonesResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetAvailabilityZonesResult + err := ctx.Invoke("aws:index/getAvailabilityZones:getAvailabilityZones", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getAvailabilityZones. +type GetAvailabilityZonesArgs struct { + // Set to `true` to include all Availability Zones and Local Zones regardless of your opt in status. + AllAvailabilityZones *bool `pulumi:"allAvailabilityZones"` + // List of Availability Zone names to exclude. + ExcludeNames []string `pulumi:"excludeNames"` + // List of Availability Zone IDs to exclude. + ExcludeZoneIds []string `pulumi:"excludeZoneIds"` + // Configuration block(s) for filtering. Detailed below. + Filters []GetAvailabilityZonesFilter `pulumi:"filters"` + // Allows to filter list of Availability Zones based on their + // current state. Can be either `"available"`, `"information"`, `"impaired"` or + // `"unavailable"`. By default the list includes a complete set of Availability Zones + // to which the underlying AWS account has access, regardless of their state. + State *string `pulumi:"state"` +} + +// A collection of values returned by getAvailabilityZones. +type GetAvailabilityZonesResult struct { + AllAvailabilityZones *bool `pulumi:"allAvailabilityZones"` + ExcludeNames []string `pulumi:"excludeNames"` + ExcludeZoneIds []string `pulumi:"excludeZoneIds"` + Filters []GetAvailabilityZonesFilter `pulumi:"filters"` + // A set of the Availability Zone Group names. For Availability Zones, this is the same value as the Region name. For Local Zones, the name of the associated group, for example `us-west-2-lax-1`. + GroupNames []string `pulumi:"groupNames"` + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + // List of the Availability Zone names available to the account. + Names []string `pulumi:"names"` + State *string `pulumi:"state"` + // List of the Availability Zone IDs available to the account. + ZoneIds []string `pulumi:"zoneIds"` +} + +func GetAvailabilityZonesOutput(ctx *pulumi.Context, args GetAvailabilityZonesOutputArgs, opts ...pulumi.InvokeOption) GetAvailabilityZonesResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetAvailabilityZonesResultOutput, error) { + args := v.(GetAvailabilityZonesArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getAvailabilityZones:getAvailabilityZones", args, GetAvailabilityZonesResultOutput{}, options).(GetAvailabilityZonesResultOutput), nil + }).(GetAvailabilityZonesResultOutput) +} + +// A collection of arguments for invoking getAvailabilityZones. +type GetAvailabilityZonesOutputArgs struct { + // Set to `true` to include all Availability Zones and Local Zones regardless of your opt in status. + AllAvailabilityZones pulumi.BoolPtrInput `pulumi:"allAvailabilityZones"` + // List of Availability Zone names to exclude. + ExcludeNames pulumi.StringArrayInput `pulumi:"excludeNames"` + // List of Availability Zone IDs to exclude. + ExcludeZoneIds pulumi.StringArrayInput `pulumi:"excludeZoneIds"` + // Configuration block(s) for filtering. Detailed below. + Filters GetAvailabilityZonesFilterArrayInput `pulumi:"filters"` + // Allows to filter list of Availability Zones based on their + // current state. Can be either `"available"`, `"information"`, `"impaired"` or + // `"unavailable"`. By default the list includes a complete set of Availability Zones + // to which the underlying AWS account has access, regardless of their state. + State pulumi.StringPtrInput `pulumi:"state"` +} + +func (GetAvailabilityZonesOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetAvailabilityZonesArgs)(nil)).Elem() +} + +// A collection of values returned by getAvailabilityZones. +type GetAvailabilityZonesResultOutput struct{ *pulumi.OutputState } + +func (GetAvailabilityZonesResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetAvailabilityZonesResult)(nil)).Elem() +} + +func (o GetAvailabilityZonesResultOutput) ToGetAvailabilityZonesResultOutput() GetAvailabilityZonesResultOutput { + return o +} + +func (o GetAvailabilityZonesResultOutput) ToGetAvailabilityZonesResultOutputWithContext(ctx context.Context) GetAvailabilityZonesResultOutput { + return o +} + +func (o GetAvailabilityZonesResultOutput) AllAvailabilityZones() pulumi.BoolPtrOutput { + return o.ApplyT(func(v GetAvailabilityZonesResult) *bool { return v.AllAvailabilityZones }).(pulumi.BoolPtrOutput) +} + +func (o GetAvailabilityZonesResultOutput) ExcludeNames() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetAvailabilityZonesResult) []string { return v.ExcludeNames }).(pulumi.StringArrayOutput) +} + +func (o GetAvailabilityZonesResultOutput) ExcludeZoneIds() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetAvailabilityZonesResult) []string { return v.ExcludeZoneIds }).(pulumi.StringArrayOutput) +} + +func (o GetAvailabilityZonesResultOutput) Filters() GetAvailabilityZonesFilterArrayOutput { + return o.ApplyT(func(v GetAvailabilityZonesResult) []GetAvailabilityZonesFilter { return v.Filters }).(GetAvailabilityZonesFilterArrayOutput) +} + +// A set of the Availability Zone Group names. For Availability Zones, this is the same value as the Region name. For Local Zones, the name of the associated group, for example `us-west-2-lax-1`. +func (o GetAvailabilityZonesResultOutput) GroupNames() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetAvailabilityZonesResult) []string { return v.GroupNames }).(pulumi.StringArrayOutput) +} + +// The provider-assigned unique ID for this managed resource. +func (o GetAvailabilityZonesResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZonesResult) string { return v.Id }).(pulumi.StringOutput) +} + +// List of the Availability Zone names available to the account. +func (o GetAvailabilityZonesResultOutput) Names() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetAvailabilityZonesResult) []string { return v.Names }).(pulumi.StringArrayOutput) +} + +func (o GetAvailabilityZonesResultOutput) State() pulumi.StringPtrOutput { + return o.ApplyT(func(v GetAvailabilityZonesResult) *string { return v.State }).(pulumi.StringPtrOutput) +} + +// List of the Availability Zone IDs available to the account. +func (o GetAvailabilityZonesResultOutput) ZoneIds() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetAvailabilityZonesResult) []string { return v.ZoneIds }).(pulumi.StringArrayOutput) +} + +func init() { + pulumi.RegisterOutputType(GetAvailabilityZonesResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getBillingServiceAccount.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getBillingServiceAccount.go new file mode 100644 index 000000000..aa7616a1c --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getBillingServiceAccount.go @@ -0,0 +1,175 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to get the Account ID of the [AWS Billing and Cost Management Service Account](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-getting-started.html#step-2) for the purpose of permitting in S3 bucket policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// main, err := aws.GetBillingServiceAccount(ctx, &aws.GetBillingServiceAccountArgs{ +// }, nil); +// if err != nil { +// return err +// } +// billingLogs, err := s3.NewBucketV2(ctx, "billing_logs", &s3.BucketV2Args{ +// Bucket: pulumi.String("my-billing-tf-test-bucket"), +// }) +// if err != nil { +// return err +// } +// _, err = s3.NewBucketAclV2(ctx, "billing_logs_acl", &s3.BucketAclV2Args{ +// Bucket: billingLogs.ID(), +// Acl: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// allowBillingLogging := pulumi.All(billingLogs.Arn,billingLogs.Arn).ApplyT(func(_args []interface{}) (iam.GetPolicyDocumentResult, error) { +// billingLogsArn := _args[0].(string) +// billingLogsArn1 := _args[1].(string) +// return iam.GetPolicyDocumentResult(iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{ +// Statements: []iam.GetPolicyDocumentStatement{ +// { +// Effect: pulumi.StringRef(pulumi.String(pulumi.StringRef("Allow"))), +// Principals: []iam.GetPolicyDocumentStatementPrincipal{ +// { +// Type: "AWS", +// Identifiers: interface{}{ +// main.Arn, +// }, +// }, +// }, +// Actions: []string{ +// "s3:GetBucketAcl", +// "s3:GetBucketPolicy", +// }, +// Resources: []string{ +// billingLogsArn, +// }, +// }, +// { +// Effect: pulumi.StringRef(pulumi.String(pulumi.StringRef("Allow"))), +// Principals: []iam.GetPolicyDocumentStatementPrincipal{ +// { +// Type: "AWS", +// Identifiers: interface{}{ +// main.Arn, +// }, +// }, +// }, +// Actions: []string{ +// "s3:PutObject", +// }, +// Resources: []string{ +// fmt.Sprintf("%v/*", billingLogsArn1), +// }, +// }, +// }, +// }, nil)), nil +// }).(iam.GetPolicyDocumentResultOutput) +// _, err = s3.NewBucketPolicy(ctx, "allow_billing_logging", &s3.BucketPolicyArgs{ +// Bucket: billingLogs.ID(), +// Policy: pulumi.String(allowBillingLogging.Json), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// ``` +func GetBillingServiceAccount(ctx *pulumi.Context, args *GetBillingServiceAccountArgs, opts ...pulumi.InvokeOption) (*GetBillingServiceAccountResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetBillingServiceAccountResult + err := ctx.Invoke("aws:index/getBillingServiceAccount:getBillingServiceAccount", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getBillingServiceAccount. +type GetBillingServiceAccountArgs struct { + // ID of the AWS billing service account. + Id *string `pulumi:"id"` +} + +// A collection of values returned by getBillingServiceAccount. +type GetBillingServiceAccountResult struct { + // ARN of the AWS billing service account. + Arn string `pulumi:"arn"` + // ID of the AWS billing service account. + Id string `pulumi:"id"` +} + +func GetBillingServiceAccountOutput(ctx *pulumi.Context, args GetBillingServiceAccountOutputArgs, opts ...pulumi.InvokeOption) GetBillingServiceAccountResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetBillingServiceAccountResultOutput, error) { + args := v.(GetBillingServiceAccountArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getBillingServiceAccount:getBillingServiceAccount", args, GetBillingServiceAccountResultOutput{}, options).(GetBillingServiceAccountResultOutput), nil + }).(GetBillingServiceAccountResultOutput) +} + +// A collection of arguments for invoking getBillingServiceAccount. +type GetBillingServiceAccountOutputArgs struct { + // ID of the AWS billing service account. + Id pulumi.StringPtrInput `pulumi:"id"` +} + +func (GetBillingServiceAccountOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetBillingServiceAccountArgs)(nil)).Elem() +} + +// A collection of values returned by getBillingServiceAccount. +type GetBillingServiceAccountResultOutput struct{ *pulumi.OutputState } + +func (GetBillingServiceAccountResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetBillingServiceAccountResult)(nil)).Elem() +} + +func (o GetBillingServiceAccountResultOutput) ToGetBillingServiceAccountResultOutput() GetBillingServiceAccountResultOutput { + return o +} + +func (o GetBillingServiceAccountResultOutput) ToGetBillingServiceAccountResultOutputWithContext(ctx context.Context) GetBillingServiceAccountResultOutput { + return o +} + +// ARN of the AWS billing service account. +func (o GetBillingServiceAccountResultOutput) Arn() pulumi.StringOutput { + return o.ApplyT(func(v GetBillingServiceAccountResult) string { return v.Arn }).(pulumi.StringOutput) +} + +// ID of the AWS billing service account. +func (o GetBillingServiceAccountResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetBillingServiceAccountResult) string { return v.Id }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterOutputType(GetBillingServiceAccountResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getCallerIdentity.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getCallerIdentity.go new file mode 100644 index 000000000..f96f8cb72 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getCallerIdentity.go @@ -0,0 +1,127 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to get the access to the effective Account ID, User ID, and ARN in +// which this provider is authorized. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil) +// if err != nil { +// return err +// } +// ctx.Export("accountId", current.AccountId) +// ctx.Export("callerArn", current.Arn) +// ctx.Export("callerUser", current.UserId) +// return nil +// }) +// } +// +// ``` +func GetCallerIdentity(ctx *pulumi.Context, args *GetCallerIdentityArgs, opts ...pulumi.InvokeOption) (*GetCallerIdentityResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetCallerIdentityResult + err := ctx.Invoke("aws:index/getCallerIdentity:getCallerIdentity", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getCallerIdentity. +type GetCallerIdentityArgs struct { + // Account ID number of the account that owns or contains the calling entity. + Id *string `pulumi:"id"` +} + +// A collection of values returned by getCallerIdentity. +type GetCallerIdentityResult struct { + // AWS Account ID number of the account that owns or contains the calling entity. + AccountId string `pulumi:"accountId"` + // ARN associated with the calling entity. + Arn string `pulumi:"arn"` + // Account ID number of the account that owns or contains the calling entity. + Id string `pulumi:"id"` + // Unique identifier of the calling entity. + UserId string `pulumi:"userId"` +} + +func GetCallerIdentityOutput(ctx *pulumi.Context, args GetCallerIdentityOutputArgs, opts ...pulumi.InvokeOption) GetCallerIdentityResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetCallerIdentityResultOutput, error) { + args := v.(GetCallerIdentityArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getCallerIdentity:getCallerIdentity", args, GetCallerIdentityResultOutput{}, options).(GetCallerIdentityResultOutput), nil + }).(GetCallerIdentityResultOutput) +} + +// A collection of arguments for invoking getCallerIdentity. +type GetCallerIdentityOutputArgs struct { + // Account ID number of the account that owns or contains the calling entity. + Id pulumi.StringPtrInput `pulumi:"id"` +} + +func (GetCallerIdentityOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetCallerIdentityArgs)(nil)).Elem() +} + +// A collection of values returned by getCallerIdentity. +type GetCallerIdentityResultOutput struct{ *pulumi.OutputState } + +func (GetCallerIdentityResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetCallerIdentityResult)(nil)).Elem() +} + +func (o GetCallerIdentityResultOutput) ToGetCallerIdentityResultOutput() GetCallerIdentityResultOutput { + return o +} + +func (o GetCallerIdentityResultOutput) ToGetCallerIdentityResultOutputWithContext(ctx context.Context) GetCallerIdentityResultOutput { + return o +} + +// AWS Account ID number of the account that owns or contains the calling entity. +func (o GetCallerIdentityResultOutput) AccountId() pulumi.StringOutput { + return o.ApplyT(func(v GetCallerIdentityResult) string { return v.AccountId }).(pulumi.StringOutput) +} + +// ARN associated with the calling entity. +func (o GetCallerIdentityResultOutput) Arn() pulumi.StringOutput { + return o.ApplyT(func(v GetCallerIdentityResult) string { return v.Arn }).(pulumi.StringOutput) +} + +// Account ID number of the account that owns or contains the calling entity. +func (o GetCallerIdentityResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetCallerIdentityResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Unique identifier of the calling entity. +func (o GetCallerIdentityResultOutput) UserId() pulumi.StringOutput { + return o.ApplyT(func(v GetCallerIdentityResult) string { return v.UserId }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterOutputType(GetCallerIdentityResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getDefaultTags.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getDefaultTags.go new file mode 100644 index 000000000..58a31b45e --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getDefaultTags.go @@ -0,0 +1,109 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to get the default tags configured on the provider. +// +// With this data source, you can apply default tags to resources not _directly_ managed by a resource, such as the instances underneath an Auto Scaling group or the volumes created for an EC2 instance. +// +// ## Example Usage +// +// ### Basic Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetDefaultTags(ctx, &aws.GetDefaultTagsArgs{}, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetDefaultTags(ctx *pulumi.Context, args *GetDefaultTagsArgs, opts ...pulumi.InvokeOption) (*GetDefaultTagsResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetDefaultTagsResult + err := ctx.Invoke("aws:index/getDefaultTags:getDefaultTags", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getDefaultTags. +type GetDefaultTagsArgs struct { + Id *string `pulumi:"id"` +} + +// A collection of values returned by getDefaultTags. +type GetDefaultTagsResult struct { + Id string `pulumi:"id"` + // Key-value mapping of provider default tags. + Tags map[string]string `pulumi:"tags"` +} + +func GetDefaultTagsOutput(ctx *pulumi.Context, args GetDefaultTagsOutputArgs, opts ...pulumi.InvokeOption) GetDefaultTagsResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetDefaultTagsResultOutput, error) { + args := v.(GetDefaultTagsArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getDefaultTags:getDefaultTags", args, GetDefaultTagsResultOutput{}, options).(GetDefaultTagsResultOutput), nil + }).(GetDefaultTagsResultOutput) +} + +// A collection of arguments for invoking getDefaultTags. +type GetDefaultTagsOutputArgs struct { + Id pulumi.StringPtrInput `pulumi:"id"` +} + +func (GetDefaultTagsOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetDefaultTagsArgs)(nil)).Elem() +} + +// A collection of values returned by getDefaultTags. +type GetDefaultTagsResultOutput struct{ *pulumi.OutputState } + +func (GetDefaultTagsResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetDefaultTagsResult)(nil)).Elem() +} + +func (o GetDefaultTagsResultOutput) ToGetDefaultTagsResultOutput() GetDefaultTagsResultOutput { + return o +} + +func (o GetDefaultTagsResultOutput) ToGetDefaultTagsResultOutputWithContext(ctx context.Context) GetDefaultTagsResultOutput { + return o +} + +func (o GetDefaultTagsResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetDefaultTagsResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Key-value mapping of provider default tags. +func (o GetDefaultTagsResultOutput) Tags() pulumi.StringMapOutput { + return o.ApplyT(func(v GetDefaultTagsResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) +} + +func init() { + pulumi.RegisterOutputType(GetDefaultTagsResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getIpRanges.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getIpRanges.go new file mode 100644 index 000000000..6e40390f8 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getIpRanges.go @@ -0,0 +1,201 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to get the IP ranges of various AWS products and services. For more information about the contents of this data source and required JSON syntax if referencing a custom URL, see the [AWS IP Address Ranges documentation](https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html). +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// europeanEc2, err := aws.GetIpRanges(ctx, &aws.GetIpRangesArgs{ +// Regions: []string{ +// "eu-west-1", +// "eu-central-1", +// }, +// Services: []string{ +// "ec2", +// }, +// }, nil) +// if err != nil { +// return err +// } +// _, err = ec2.NewSecurityGroup(ctx, "from_europe", &ec2.SecurityGroupArgs{ +// Name: pulumi.String("from_europe"), +// Ingress: ec2.SecurityGroupIngressArray{ +// &ec2.SecurityGroupIngressArgs{ +// FromPort: pulumi.Int(443), +// ToPort: pulumi.Int(443), +// Protocol: pulumi.String("tcp"), +// CidrBlocks: interface{}(europeanEc2.CidrBlocks), +// Ipv6CidrBlocks: interface{}(europeanEc2.Ipv6CidrBlocks), +// }, +// }, +// Tags: pulumi.StringMap{ +// "CreateDate": pulumi.String(europeanEc2.CreateDate), +// "SyncToken": pulumi.Int(europeanEc2.SyncToken), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetIpRanges(ctx *pulumi.Context, args *GetIpRangesArgs, opts ...pulumi.InvokeOption) (*GetIpRangesResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetIpRangesResult + err := ctx.Invoke("aws:index/getIpRanges:getIpRanges", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getIpRanges. +type GetIpRangesArgs struct { + Id *string `pulumi:"id"` + // Filter IP ranges by regions (or include all regions, if + // omitted). Valid items are `global` (for `cloudfront`) as well as all AWS regions + // (e.g., `eu-central-1`) + Regions []string `pulumi:"regions"` + // Filter IP ranges by services. Valid items are `amazon` + // (for amazon.com), `amazonConnect`, `apiGateway`, `cloud9`, `cloudfront`, + // `codebuild`, `dynamodb`, `ec2`, `ec2InstanceConnect`, `globalaccelerator`, + // `route53`, `route53Healthchecks`, `s3` and `workspacesGateways`. See the + // [`service` attribute][2] documentation for other possible values. + // + // > **NOTE:** If the specified combination of regions and services does not yield any + // CIDR blocks, this call will fail. + Services []string `pulumi:"services"` + // Custom URL for source JSON file. Syntax must match [AWS IP Address Ranges documentation](https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html). Defaults to `https://ip-ranges.amazonaws.com/ip-ranges.json`. + Url *string `pulumi:"url"` +} + +// A collection of values returned by getIpRanges. +type GetIpRangesResult struct { + // Lexically ordered list of CIDR blocks. + CidrBlocks []string `pulumi:"cidrBlocks"` + // Publication time of the IP ranges (e.g., `2016-08-03-23-46-05`). + CreateDate string `pulumi:"createDate"` + Id string `pulumi:"id"` + // Lexically ordered list of IPv6 CIDR blocks. + Ipv6CidrBlocks []string `pulumi:"ipv6CidrBlocks"` + Regions []string `pulumi:"regions"` + Services []string `pulumi:"services"` + // Publication time of the IP ranges, in Unix epoch time format + // (e.g., `1470267965`). + SyncToken int `pulumi:"syncToken"` + Url *string `pulumi:"url"` +} + +func GetIpRangesOutput(ctx *pulumi.Context, args GetIpRangesOutputArgs, opts ...pulumi.InvokeOption) GetIpRangesResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetIpRangesResultOutput, error) { + args := v.(GetIpRangesArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getIpRanges:getIpRanges", args, GetIpRangesResultOutput{}, options).(GetIpRangesResultOutput), nil + }).(GetIpRangesResultOutput) +} + +// A collection of arguments for invoking getIpRanges. +type GetIpRangesOutputArgs struct { + Id pulumi.StringPtrInput `pulumi:"id"` + // Filter IP ranges by regions (or include all regions, if + // omitted). Valid items are `global` (for `cloudfront`) as well as all AWS regions + // (e.g., `eu-central-1`) + Regions pulumi.StringArrayInput `pulumi:"regions"` + // Filter IP ranges by services. Valid items are `amazon` + // (for amazon.com), `amazonConnect`, `apiGateway`, `cloud9`, `cloudfront`, + // `codebuild`, `dynamodb`, `ec2`, `ec2InstanceConnect`, `globalaccelerator`, + // `route53`, `route53Healthchecks`, `s3` and `workspacesGateways`. See the + // [`service` attribute][2] documentation for other possible values. + // + // > **NOTE:** If the specified combination of regions and services does not yield any + // CIDR blocks, this call will fail. + Services pulumi.StringArrayInput `pulumi:"services"` + // Custom URL for source JSON file. Syntax must match [AWS IP Address Ranges documentation](https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html). Defaults to `https://ip-ranges.amazonaws.com/ip-ranges.json`. + Url pulumi.StringPtrInput `pulumi:"url"` +} + +func (GetIpRangesOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetIpRangesArgs)(nil)).Elem() +} + +// A collection of values returned by getIpRanges. +type GetIpRangesResultOutput struct{ *pulumi.OutputState } + +func (GetIpRangesResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetIpRangesResult)(nil)).Elem() +} + +func (o GetIpRangesResultOutput) ToGetIpRangesResultOutput() GetIpRangesResultOutput { + return o +} + +func (o GetIpRangesResultOutput) ToGetIpRangesResultOutputWithContext(ctx context.Context) GetIpRangesResultOutput { + return o +} + +// Lexically ordered list of CIDR blocks. +func (o GetIpRangesResultOutput) CidrBlocks() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetIpRangesResult) []string { return v.CidrBlocks }).(pulumi.StringArrayOutput) +} + +// Publication time of the IP ranges (e.g., `2016-08-03-23-46-05`). +func (o GetIpRangesResultOutput) CreateDate() pulumi.StringOutput { + return o.ApplyT(func(v GetIpRangesResult) string { return v.CreateDate }).(pulumi.StringOutput) +} + +func (o GetIpRangesResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetIpRangesResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Lexically ordered list of IPv6 CIDR blocks. +func (o GetIpRangesResultOutput) Ipv6CidrBlocks() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetIpRangesResult) []string { return v.Ipv6CidrBlocks }).(pulumi.StringArrayOutput) +} + +func (o GetIpRangesResultOutput) Regions() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetIpRangesResult) []string { return v.Regions }).(pulumi.StringArrayOutput) +} + +func (o GetIpRangesResultOutput) Services() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetIpRangesResult) []string { return v.Services }).(pulumi.StringArrayOutput) +} + +// Publication time of the IP ranges, in Unix epoch time format +// (e.g., `1470267965`). +func (o GetIpRangesResultOutput) SyncToken() pulumi.IntOutput { + return o.ApplyT(func(v GetIpRangesResult) int { return v.SyncToken }).(pulumi.IntOutput) +} + +func (o GetIpRangesResultOutput) Url() pulumi.StringPtrOutput { + return o.ApplyT(func(v GetIpRangesResult) *string { return v.Url }).(pulumi.StringPtrOutput) +} + +func init() { + pulumi.RegisterOutputType(GetIpRangesResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getPartition.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getPartition.go new file mode 100644 index 000000000..24e274606 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getPartition.go @@ -0,0 +1,143 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to lookup information about the current AWS partition in +// which the provider is working. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := aws.GetPartition(ctx, &aws.GetPartitionArgs{}, nil) +// if err != nil { +// return err +// } +// _, err = iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{ +// Statements: []iam.GetPolicyDocumentStatement{ +// { +// Sid: pulumi.StringRef("1"), +// Actions: []string{ +// "s3:ListBucket", +// }, +// Resources: []string{ +// fmt.Sprintf("arn:%v:s3:::my-bucket", current.Partition), +// }, +// }, +// }, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetPartition(ctx *pulumi.Context, args *GetPartitionArgs, opts ...pulumi.InvokeOption) (*GetPartitionResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetPartitionResult + err := ctx.Invoke("aws:index/getPartition:getPartition", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getPartition. +type GetPartitionArgs struct { + // Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). + Id *string `pulumi:"id"` +} + +// A collection of values returned by getPartition. +type GetPartitionResult struct { + // Base DNS domain name for the current partition (e.g., `amazonaws.com` in AWS Commercial, `amazonaws.com.cn` in AWS China). + DnsSuffix string `pulumi:"dnsSuffix"` + // Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). + Id string `pulumi:"id"` + // Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). + Partition string `pulumi:"partition"` + // Prefix of service names (e.g., `com.amazonaws` in AWS Commercial, `cn.com.amazonaws` in AWS China). + ReverseDnsPrefix string `pulumi:"reverseDnsPrefix"` +} + +func GetPartitionOutput(ctx *pulumi.Context, args GetPartitionOutputArgs, opts ...pulumi.InvokeOption) GetPartitionResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetPartitionResultOutput, error) { + args := v.(GetPartitionArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getPartition:getPartition", args, GetPartitionResultOutput{}, options).(GetPartitionResultOutput), nil + }).(GetPartitionResultOutput) +} + +// A collection of arguments for invoking getPartition. +type GetPartitionOutputArgs struct { + // Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). + Id pulumi.StringPtrInput `pulumi:"id"` +} + +func (GetPartitionOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetPartitionArgs)(nil)).Elem() +} + +// A collection of values returned by getPartition. +type GetPartitionResultOutput struct{ *pulumi.OutputState } + +func (GetPartitionResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetPartitionResult)(nil)).Elem() +} + +func (o GetPartitionResultOutput) ToGetPartitionResultOutput() GetPartitionResultOutput { + return o +} + +func (o GetPartitionResultOutput) ToGetPartitionResultOutputWithContext(ctx context.Context) GetPartitionResultOutput { + return o +} + +// Base DNS domain name for the current partition (e.g., `amazonaws.com` in AWS Commercial, `amazonaws.com.cn` in AWS China). +func (o GetPartitionResultOutput) DnsSuffix() pulumi.StringOutput { + return o.ApplyT(func(v GetPartitionResult) string { return v.DnsSuffix }).(pulumi.StringOutput) +} + +// Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). +func (o GetPartitionResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetPartitionResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). +func (o GetPartitionResultOutput) Partition() pulumi.StringOutput { + return o.ApplyT(func(v GetPartitionResult) string { return v.Partition }).(pulumi.StringOutput) +} + +// Prefix of service names (e.g., `com.amazonaws` in AWS Commercial, `cn.com.amazonaws` in AWS China). +func (o GetPartitionResultOutput) ReverseDnsPrefix() pulumi.StringOutput { + return o.ApplyT(func(v GetPartitionResult) string { return v.ReverseDnsPrefix }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterOutputType(GetPartitionResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getRegion.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getRegion.go new file mode 100644 index 000000000..3736414c7 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getRegion.go @@ -0,0 +1,135 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// `getRegion` provides details about a specific AWS region. +// +// As well as validating a given region name this resource can be used to +// discover the name of the region configured within the provider. The latter +// can be useful in a child module which is inheriting an AWS provider +// configuration from its parent module. +// +// ## Example Usage +// +// The following example shows how the resource might be used to obtain +// the name of the AWS region configured on the provider. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetRegion(ctx, &aws.GetRegionArgs{}, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetRegion(ctx *pulumi.Context, args *GetRegionArgs, opts ...pulumi.InvokeOption) (*GetRegionResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetRegionResult + err := ctx.Invoke("aws:index/getRegion:getRegion", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getRegion. +type GetRegionArgs struct { + // EC2 endpoint of the region to select. + Endpoint *string `pulumi:"endpoint"` + Id *string `pulumi:"id"` + // Full name of the region to select. + Name *string `pulumi:"name"` +} + +// A collection of values returned by getRegion. +type GetRegionResult struct { + // Region's description in this format: "Location (Region name)". + Description string `pulumi:"description"` + // EC2 endpoint for the selected region. + Endpoint string `pulumi:"endpoint"` + Id string `pulumi:"id"` + // Name of the selected region. + Name string `pulumi:"name"` +} + +func GetRegionOutput(ctx *pulumi.Context, args GetRegionOutputArgs, opts ...pulumi.InvokeOption) GetRegionResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetRegionResultOutput, error) { + args := v.(GetRegionArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getRegion:getRegion", args, GetRegionResultOutput{}, options).(GetRegionResultOutput), nil + }).(GetRegionResultOutput) +} + +// A collection of arguments for invoking getRegion. +type GetRegionOutputArgs struct { + // EC2 endpoint of the region to select. + Endpoint pulumi.StringPtrInput `pulumi:"endpoint"` + Id pulumi.StringPtrInput `pulumi:"id"` + // Full name of the region to select. + Name pulumi.StringPtrInput `pulumi:"name"` +} + +func (GetRegionOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetRegionArgs)(nil)).Elem() +} + +// A collection of values returned by getRegion. +type GetRegionResultOutput struct{ *pulumi.OutputState } + +func (GetRegionResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetRegionResult)(nil)).Elem() +} + +func (o GetRegionResultOutput) ToGetRegionResultOutput() GetRegionResultOutput { + return o +} + +func (o GetRegionResultOutput) ToGetRegionResultOutputWithContext(ctx context.Context) GetRegionResultOutput { + return o +} + +// Region's description in this format: "Location (Region name)". +func (o GetRegionResultOutput) Description() pulumi.StringOutput { + return o.ApplyT(func(v GetRegionResult) string { return v.Description }).(pulumi.StringOutput) +} + +// EC2 endpoint for the selected region. +func (o GetRegionResultOutput) Endpoint() pulumi.StringOutput { + return o.ApplyT(func(v GetRegionResult) string { return v.Endpoint }).(pulumi.StringOutput) +} + +func (o GetRegionResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetRegionResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Name of the selected region. +func (o GetRegionResultOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetRegionResult) string { return v.Name }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterOutputType(GetRegionResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getRegions.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getRegions.go new file mode 100644 index 000000000..c9fea9338 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getRegions.go @@ -0,0 +1,189 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Provides information about AWS Regions. Can be used to filter regions i.e., by Opt-In status or only regions enabled for current account. To get details like endpoint and description of each region the data source can be combined with the `getRegion` data source. +// +// ## Example Usage +// +// Enabled AWS Regions: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetRegions(ctx, &aws.GetRegionsArgs{}, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// # All the regions regardless of the availability +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetRegions(ctx, &aws.GetRegionsArgs{ +// AllRegions: pulumi.BoolRef(true), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// To see regions that are filtered by `"not-opted-in"`, the `allRegions` argument needs to be set to `true` or no results will be returned. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetRegions(ctx, &aws.GetRegionsArgs{ +// AllRegions: pulumi.BoolRef(true), +// Filters: []aws.GetRegionsFilter{ +// { +// Name: "opt-in-status", +// Values: []string{ +// "not-opted-in", +// }, +// }, +// }, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetRegions(ctx *pulumi.Context, args *GetRegionsArgs, opts ...pulumi.InvokeOption) (*GetRegionsResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetRegionsResult + err := ctx.Invoke("aws:index/getRegions:getRegions", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getRegions. +type GetRegionsArgs struct { + // If true the source will query all regions regardless of availability. + AllRegions *bool `pulumi:"allRegions"` + // Configuration block(s) to use as filters. Detailed below. + Filters []GetRegionsFilter `pulumi:"filters"` + // Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). + Id *string `pulumi:"id"` +} + +// A collection of values returned by getRegions. +type GetRegionsResult struct { + AllRegions *bool `pulumi:"allRegions"` + Filters []GetRegionsFilter `pulumi:"filters"` + // Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). + Id string `pulumi:"id"` + // Names of regions that meets the criteria. + Names []string `pulumi:"names"` +} + +func GetRegionsOutput(ctx *pulumi.Context, args GetRegionsOutputArgs, opts ...pulumi.InvokeOption) GetRegionsResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetRegionsResultOutput, error) { + args := v.(GetRegionsArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getRegions:getRegions", args, GetRegionsResultOutput{}, options).(GetRegionsResultOutput), nil + }).(GetRegionsResultOutput) +} + +// A collection of arguments for invoking getRegions. +type GetRegionsOutputArgs struct { + // If true the source will query all regions regardless of availability. + AllRegions pulumi.BoolPtrInput `pulumi:"allRegions"` + // Configuration block(s) to use as filters. Detailed below. + Filters GetRegionsFilterArrayInput `pulumi:"filters"` + // Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). + Id pulumi.StringPtrInput `pulumi:"id"` +} + +func (GetRegionsOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetRegionsArgs)(nil)).Elem() +} + +// A collection of values returned by getRegions. +type GetRegionsResultOutput struct{ *pulumi.OutputState } + +func (GetRegionsResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetRegionsResult)(nil)).Elem() +} + +func (o GetRegionsResultOutput) ToGetRegionsResultOutput() GetRegionsResultOutput { + return o +} + +func (o GetRegionsResultOutput) ToGetRegionsResultOutputWithContext(ctx context.Context) GetRegionsResultOutput { + return o +} + +func (o GetRegionsResultOutput) AllRegions() pulumi.BoolPtrOutput { + return o.ApplyT(func(v GetRegionsResult) *bool { return v.AllRegions }).(pulumi.BoolPtrOutput) +} + +func (o GetRegionsResultOutput) Filters() GetRegionsFilterArrayOutput { + return o.ApplyT(func(v GetRegionsResult) []GetRegionsFilter { return v.Filters }).(GetRegionsFilterArrayOutput) +} + +// Identifier of the current partition (e.g., `aws` in AWS Commercial, `aws-cn` in AWS China). +func (o GetRegionsResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetRegionsResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Names of regions that meets the criteria. +func (o GetRegionsResultOutput) Names() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetRegionsResult) []string { return v.Names }).(pulumi.StringArrayOutput) +} + +func init() { + pulumi.RegisterOutputType(GetRegionsResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getService.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getService.go new file mode 100644 index 000000000..5d4c1bd37 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getService.go @@ -0,0 +1,216 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to compose and decompose AWS service DNS names. +// +// ## Example Usage +// +// ### Get Service DNS Name +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := aws.GetRegion(ctx, &aws.GetRegionArgs{}, nil) +// if err != nil { +// return err +// } +// _, err = aws.GetService(ctx, &aws.GetServiceArgs{ +// Region: pulumi.StringRef(current.Name), +// ServiceId: pulumi.StringRef("ec2"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ### Use Service Reverse DNS Name to Get Components +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetService(ctx, &aws.GetServiceArgs{ +// ReverseDnsName: pulumi.StringRef("cn.com.amazonaws.cn-north-1.s3"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ### Determine Regional Support for a Service +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetService(ctx, &aws.GetServiceArgs{ +// ReverseDnsName: pulumi.StringRef("com.amazonaws.us-gov-west-1.waf"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetService(ctx *pulumi.Context, args *GetServiceArgs, opts ...pulumi.InvokeOption) (*GetServiceResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetServiceResult + err := ctx.Invoke("aws:index/getService:getService", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getService. +type GetServiceArgs struct { + // DNS name of the service (_e.g.,_ `rds.us-east-1.amazonaws.com`). One of `dnsName`, `reverseDnsName`, or `serviceId` is required. + DnsName *string `pulumi:"dnsName"` + Id *string `pulumi:"id"` + // Region of the service (_e.g.,_ `us-west-2`, `ap-northeast-1`). + Region *string `pulumi:"region"` + // Reverse DNS name of the service (_e.g.,_ `com.amazonaws.us-west-2.s3`). One of `dnsName`, `reverseDnsName`, or `serviceId` is required. + ReverseDnsName *string `pulumi:"reverseDnsName"` + // Prefix of the service (_e.g.,_ `com.amazonaws` in AWS Commercial, `cn.com.amazonaws` in AWS China). + ReverseDnsPrefix *string `pulumi:"reverseDnsPrefix"` + // Service endpoint ID (_e.g.,_ `s3`, `rds`, `ec2`). One of `dnsName`, `reverseDnsName`, or `serviceId` is required. A service's endpoint ID can be found in the [_AWS General Reference_](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html). + ServiceId *string `pulumi:"serviceId"` +} + +// A collection of values returned by getService. +type GetServiceResult struct { + DnsName string `pulumi:"dnsName"` + Id string `pulumi:"id"` + Partition string `pulumi:"partition"` + Region string `pulumi:"region"` + ReverseDnsName string `pulumi:"reverseDnsName"` + ReverseDnsPrefix string `pulumi:"reverseDnsPrefix"` + ServiceId string `pulumi:"serviceId"` + // Whether the service is supported in the region's partition. New services may not be listed immediately as supported. + Supported bool `pulumi:"supported"` +} + +func GetServiceOutput(ctx *pulumi.Context, args GetServiceOutputArgs, opts ...pulumi.InvokeOption) GetServiceResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetServiceResultOutput, error) { + args := v.(GetServiceArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getService:getService", args, GetServiceResultOutput{}, options).(GetServiceResultOutput), nil + }).(GetServiceResultOutput) +} + +// A collection of arguments for invoking getService. +type GetServiceOutputArgs struct { + // DNS name of the service (_e.g.,_ `rds.us-east-1.amazonaws.com`). One of `dnsName`, `reverseDnsName`, or `serviceId` is required. + DnsName pulumi.StringPtrInput `pulumi:"dnsName"` + Id pulumi.StringPtrInput `pulumi:"id"` + // Region of the service (_e.g.,_ `us-west-2`, `ap-northeast-1`). + Region pulumi.StringPtrInput `pulumi:"region"` + // Reverse DNS name of the service (_e.g.,_ `com.amazonaws.us-west-2.s3`). One of `dnsName`, `reverseDnsName`, or `serviceId` is required. + ReverseDnsName pulumi.StringPtrInput `pulumi:"reverseDnsName"` + // Prefix of the service (_e.g.,_ `com.amazonaws` in AWS Commercial, `cn.com.amazonaws` in AWS China). + ReverseDnsPrefix pulumi.StringPtrInput `pulumi:"reverseDnsPrefix"` + // Service endpoint ID (_e.g.,_ `s3`, `rds`, `ec2`). One of `dnsName`, `reverseDnsName`, or `serviceId` is required. A service's endpoint ID can be found in the [_AWS General Reference_](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html). + ServiceId pulumi.StringPtrInput `pulumi:"serviceId"` +} + +func (GetServiceOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetServiceArgs)(nil)).Elem() +} + +// A collection of values returned by getService. +type GetServiceResultOutput struct{ *pulumi.OutputState } + +func (GetServiceResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetServiceResult)(nil)).Elem() +} + +func (o GetServiceResultOutput) ToGetServiceResultOutput() GetServiceResultOutput { + return o +} + +func (o GetServiceResultOutput) ToGetServiceResultOutputWithContext(ctx context.Context) GetServiceResultOutput { + return o +} + +func (o GetServiceResultOutput) DnsName() pulumi.StringOutput { + return o.ApplyT(func(v GetServiceResult) string { return v.DnsName }).(pulumi.StringOutput) +} + +func (o GetServiceResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetServiceResult) string { return v.Id }).(pulumi.StringOutput) +} + +func (o GetServiceResultOutput) Partition() pulumi.StringOutput { + return o.ApplyT(func(v GetServiceResult) string { return v.Partition }).(pulumi.StringOutput) +} + +func (o GetServiceResultOutput) Region() pulumi.StringOutput { + return o.ApplyT(func(v GetServiceResult) string { return v.Region }).(pulumi.StringOutput) +} + +func (o GetServiceResultOutput) ReverseDnsName() pulumi.StringOutput { + return o.ApplyT(func(v GetServiceResult) string { return v.ReverseDnsName }).(pulumi.StringOutput) +} + +func (o GetServiceResultOutput) ReverseDnsPrefix() pulumi.StringOutput { + return o.ApplyT(func(v GetServiceResult) string { return v.ReverseDnsPrefix }).(pulumi.StringOutput) +} + +func (o GetServiceResultOutput) ServiceId() pulumi.StringOutput { + return o.ApplyT(func(v GetServiceResult) string { return v.ServiceId }).(pulumi.StringOutput) +} + +// Whether the service is supported in the region's partition. New services may not be listed immediately as supported. +func (o GetServiceResultOutput) Supported() pulumi.BoolOutput { + return o.ApplyT(func(v GetServiceResult) bool { return v.Supported }).(pulumi.BoolOutput) +} + +func init() { + pulumi.RegisterOutputType(GetServiceResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getServicePrincipal.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getServicePrincipal.go new file mode 100644 index 000000000..cf44e8da7 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/getServicePrincipal.go @@ -0,0 +1,141 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to create a Service Principal Name for a service in a given region. Service Principal Names should always end in the standard global format: `{servicename}.amazonaws.com`. However, in some AWS partitions, AWS may expect a different format. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aws.GetServicePrincipal(ctx, &aws.GetServicePrincipalArgs{ +// ServiceName: "s3", +// }, nil) +// if err != nil { +// return err +// } +// _, err = aws.GetServicePrincipal(ctx, &aws.GetServicePrincipalArgs{ +// ServiceName: "s3", +// Region: pulumi.StringRef("us-iso-east-1"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetServicePrincipal(ctx *pulumi.Context, args *GetServicePrincipalArgs, opts ...pulumi.InvokeOption) (*GetServicePrincipalResult, error) { + opts = internal.PkgInvokeDefaultOpts(opts) + var rv GetServicePrincipalResult + err := ctx.Invoke("aws:index/getServicePrincipal:getServicePrincipal", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getServicePrincipal. +type GetServicePrincipalArgs struct { + // Region you'd like the SPN for. By default, uses the current region. + Region *string `pulumi:"region"` + // Name of the service you want to generate a Service Principal Name for. + ServiceName string `pulumi:"serviceName"` +} + +// A collection of values returned by getServicePrincipal. +type GetServicePrincipalResult struct { + // Identifier of the current Service Principal (compound of service, region and suffix). (e.g. `logs.us-east-1.amazonaws.com`in AWS Commercial, `logs.cn-north-1.amazonaws.com.cn` in AWS China). + Id string `pulumi:"id"` + // Service Principal Name (e.g., `logs.amazonaws.com` in AWS Commercial, `logs.amazonaws.com.cn` in AWS China). + Name string `pulumi:"name"` + // Region identifier of the generated SPN (e.g., `us-east-1` in AWS Commercial, `cn-north-1` in AWS China). + Region string `pulumi:"region"` + ServiceName string `pulumi:"serviceName"` + // Suffix of the SPN (e.g., `amazonaws.com` in AWS Commercial, `amazonaws.com.cn` in AWS China). + Suffix string `pulumi:"suffix"` +} + +func GetServicePrincipalOutput(ctx *pulumi.Context, args GetServicePrincipalOutputArgs, opts ...pulumi.InvokeOption) GetServicePrincipalResultOutput { + return pulumi.ToOutputWithContext(ctx.Context(), args). + ApplyT(func(v interface{}) (GetServicePrincipalResultOutput, error) { + args := v.(GetServicePrincipalArgs) + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("aws:index/getServicePrincipal:getServicePrincipal", args, GetServicePrincipalResultOutput{}, options).(GetServicePrincipalResultOutput), nil + }).(GetServicePrincipalResultOutput) +} + +// A collection of arguments for invoking getServicePrincipal. +type GetServicePrincipalOutputArgs struct { + // Region you'd like the SPN for. By default, uses the current region. + Region pulumi.StringPtrInput `pulumi:"region"` + // Name of the service you want to generate a Service Principal Name for. + ServiceName pulumi.StringInput `pulumi:"serviceName"` +} + +func (GetServicePrincipalOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetServicePrincipalArgs)(nil)).Elem() +} + +// A collection of values returned by getServicePrincipal. +type GetServicePrincipalResultOutput struct{ *pulumi.OutputState } + +func (GetServicePrincipalResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetServicePrincipalResult)(nil)).Elem() +} + +func (o GetServicePrincipalResultOutput) ToGetServicePrincipalResultOutput() GetServicePrincipalResultOutput { + return o +} + +func (o GetServicePrincipalResultOutput) ToGetServicePrincipalResultOutputWithContext(ctx context.Context) GetServicePrincipalResultOutput { + return o +} + +// Identifier of the current Service Principal (compound of service, region and suffix). (e.g. `logs.us-east-1.amazonaws.com`in AWS Commercial, `logs.cn-north-1.amazonaws.com.cn` in AWS China). +func (o GetServicePrincipalResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetServicePrincipalResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Service Principal Name (e.g., `logs.amazonaws.com` in AWS Commercial, `logs.amazonaws.com.cn` in AWS China). +func (o GetServicePrincipalResultOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetServicePrincipalResult) string { return v.Name }).(pulumi.StringOutput) +} + +// Region identifier of the generated SPN (e.g., `us-east-1` in AWS Commercial, `cn-north-1` in AWS China). +func (o GetServicePrincipalResultOutput) Region() pulumi.StringOutput { + return o.ApplyT(func(v GetServicePrincipalResult) string { return v.Region }).(pulumi.StringOutput) +} + +func (o GetServicePrincipalResultOutput) ServiceName() pulumi.StringOutput { + return o.ApplyT(func(v GetServicePrincipalResult) string { return v.ServiceName }).(pulumi.StringOutput) +} + +// Suffix of the SPN (e.g., `amazonaws.com` in AWS Commercial, `amazonaws.com.cn` in AWS China). +func (o GetServicePrincipalResultOutput) Suffix() pulumi.StringOutput { + return o.ApplyT(func(v GetServicePrincipalResult) string { return v.Suffix }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterOutputType(GetServicePrincipalResultOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/init.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/init.go new file mode 100644 index 000000000..ab4dc5b16 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/init.go @@ -0,0 +1,41 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "fmt" + + "github.com/blang/semver" + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +type pkg struct { + version semver.Version +} + +func (p *pkg) Version() semver.Version { + return p.version +} + +func (p *pkg) ConstructProvider(ctx *pulumi.Context, name, typ, urn string) (pulumi.ProviderResource, error) { + if typ != "pulumi:providers:aws" { + return nil, fmt.Errorf("unknown provider type: %s", typ) + } + + r := &Provider{} + err := ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) + return r, err +} + +func init() { + version, err := internal.PkgVersion() + if err != nil { + version = semver.Version{Major: 1} + } + pulumi.RegisterResourcePackage( + "aws", + &pkg{version}, + ) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/provider.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/provider.go new file mode 100644 index 000000000..96cba8a61 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/provider.go @@ -0,0 +1,376 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// The provider type for the aws package. By default, resources use package-wide configuration +// settings, however an explicit `Provider` instance may be created and passed during resource +// construction to achieve fine-grained programmatic control over provider settings. See the +// [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information. +type Provider struct { + pulumi.ProviderResourceState + + // The access key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console. + AccessKey pulumi.StringPtrOutput `pulumi:"accessKey"` + // File containing custom root and intermediate certificates. Can also be configured using the `AWS_CA_BUNDLE` environment + // variable. (Setting `caBundle` in the shared config file is not supported.) + CustomCaBundle pulumi.StringPtrOutput `pulumi:"customCaBundle"` + // Address of the EC2 metadata service endpoint to use. Can also be configured using the + // `AWS_EC2_METADATA_SERVICE_ENDPOINT` environment variable. + Ec2MetadataServiceEndpoint pulumi.StringPtrOutput `pulumi:"ec2MetadataServiceEndpoint"` + // Protocol to use with EC2 metadata service endpoint.Valid values are `IPv4` and `IPv6`. Can also be configured using the + // `AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE` environment variable. + Ec2MetadataServiceEndpointMode pulumi.StringPtrOutput `pulumi:"ec2MetadataServiceEndpointMode"` + // URL of a proxy to use for HTTP requests when accessing the AWS API. Can also be set using the `HTTP_PROXY` or + // `httpProxy` environment variables. + HttpProxy pulumi.StringPtrOutput `pulumi:"httpProxy"` + // URL of a proxy to use for HTTPS requests when accessing the AWS API. Can also be set using the `HTTPS_PROXY` or + // `httpsProxy` environment variables. + HttpsProxy pulumi.StringPtrOutput `pulumi:"httpsProxy"` + // Comma-separated list of hosts that should not use HTTP or HTTPS proxies. Can also be set using the `NO_PROXY` or + // `noProxy` environment variables. + NoProxy pulumi.StringPtrOutput `pulumi:"noProxy"` + // The profile for API operations. If not set, the default profile created with `aws configure` will be used. + Profile pulumi.StringPtrOutput `pulumi:"profile"` + // The region where AWS operations will take place. Examples are us-east-1, us-west-2, etc. + Region pulumi.StringPtrOutput `pulumi:"region"` + // Specifies how retries are attempted. Valid values are `standard` and `adaptive`. Can also be configured using the + // `AWS_RETRY_MODE` environment variable. + RetryMode pulumi.StringPtrOutput `pulumi:"retryMode"` + // Specifies whether S3 API calls in the `us-east-1` region use the legacy global endpoint or a regional endpoint. Valid + // values are `legacy` or `regional`. Can also be configured using the `AWS_S3_US_EAST_1_REGIONAL_ENDPOINT` environment + // variable or the `s3UsEast1RegionalEndpoint` shared config file parameter + S3UsEast1RegionalEndpoint pulumi.StringPtrOutput `pulumi:"s3UsEast1RegionalEndpoint"` + // The secret key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console. + SecretKey pulumi.StringPtrOutput `pulumi:"secretKey"` + // The region where AWS STS operations will take place. Examples are us-east-1 and us-west-2. + StsRegion pulumi.StringPtrOutput `pulumi:"stsRegion"` + // session token. A session token is only required if you are using temporary security credentials. + Token pulumi.StringPtrOutput `pulumi:"token"` +} + +// NewProvider registers a new resource with the given unique name, arguments, and options. +func NewProvider(ctx *pulumi.Context, + name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) { + if args == nil { + args = &ProviderArgs{} + } + + if args.Region == nil { + if d := internal.GetEnvOrDefault(nil, nil, "AWS_REGION", "AWS_DEFAULT_REGION"); d != nil { + args.Region = pulumi.StringPtr(d.(string)) + } + } + if args.SkipCredentialsValidation == nil { + args.SkipCredentialsValidation = pulumi.BoolPtr(false) + } + if args.SkipRegionValidation == nil { + args.SkipRegionValidation = pulumi.BoolPtr(true) + } + if args.AccessKey != nil { + args.AccessKey = pulumi.ToSecret(args.AccessKey).(pulumi.StringPtrInput) + } + if args.SecretKey != nil { + args.SecretKey = pulumi.ToSecret(args.SecretKey).(pulumi.StringPtrInput) + } + if args.Token != nil { + args.Token = pulumi.ToSecret(args.Token).(pulumi.StringPtrInput) + } + secrets := pulumi.AdditionalSecretOutputs([]string{ + "accessKey", + "secretKey", + "token", + }) + opts = append(opts, secrets) + opts = internal.PkgResourceDefaultOpts(opts) + var resource Provider + err := ctx.RegisterResource("pulumi:providers:aws", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +type providerArgs struct { + // The access key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console. + AccessKey *string `pulumi:"accessKey"` + AllowedAccountIds []string `pulumi:"allowedAccountIds"` + AssumeRole *ProviderAssumeRole `pulumi:"assumeRole"` + AssumeRoleWithWebIdentity *ProviderAssumeRoleWithWebIdentity `pulumi:"assumeRoleWithWebIdentity"` + // File containing custom root and intermediate certificates. Can also be configured using the `AWS_CA_BUNDLE` environment + // variable. (Setting `caBundle` in the shared config file is not supported.) + CustomCaBundle *string `pulumi:"customCaBundle"` + // Configuration block with settings to default resource tags across all resources. + DefaultTags *ProviderDefaultTags `pulumi:"defaultTags"` + // Address of the EC2 metadata service endpoint to use. Can also be configured using the + // `AWS_EC2_METADATA_SERVICE_ENDPOINT` environment variable. + Ec2MetadataServiceEndpoint *string `pulumi:"ec2MetadataServiceEndpoint"` + // Protocol to use with EC2 metadata service endpoint.Valid values are `IPv4` and `IPv6`. Can also be configured using the + // `AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE` environment variable. + Ec2MetadataServiceEndpointMode *string `pulumi:"ec2MetadataServiceEndpointMode"` + Endpoints []ProviderEndpoint `pulumi:"endpoints"` + ForbiddenAccountIds []string `pulumi:"forbiddenAccountIds"` + // URL of a proxy to use for HTTP requests when accessing the AWS API. Can also be set using the `HTTP_PROXY` or + // `httpProxy` environment variables. + HttpProxy *string `pulumi:"httpProxy"` + // URL of a proxy to use for HTTPS requests when accessing the AWS API. Can also be set using the `HTTPS_PROXY` or + // `httpsProxy` environment variables. + HttpsProxy *string `pulumi:"httpsProxy"` + // Configuration block with settings to ignore resource tags across all resources. + IgnoreTags *ProviderIgnoreTags `pulumi:"ignoreTags"` + // Explicitly allow the provider to perform "insecure" SSL requests. If omitted, default value is `false` + Insecure *bool `pulumi:"insecure"` + // The maximum number of times an AWS API request is being executed. If the API request still fails, an error is thrown. + MaxRetries *int `pulumi:"maxRetries"` + // Comma-separated list of hosts that should not use HTTP or HTTPS proxies. Can also be set using the `NO_PROXY` or + // `noProxy` environment variables. + NoProxy *string `pulumi:"noProxy"` + // The profile for API operations. If not set, the default profile created with `aws configure` will be used. + Profile *string `pulumi:"profile"` + // The region where AWS operations will take place. Examples are us-east-1, us-west-2, etc. + Region *string `pulumi:"region"` + // Specifies how retries are attempted. Valid values are `standard` and `adaptive`. Can also be configured using the + // `AWS_RETRY_MODE` environment variable. + RetryMode *string `pulumi:"retryMode"` + // Specifies whether S3 API calls in the `us-east-1` region use the legacy global endpoint or a regional endpoint. Valid + // values are `legacy` or `regional`. Can also be configured using the `AWS_S3_US_EAST_1_REGIONAL_ENDPOINT` environment + // variable or the `s3UsEast1RegionalEndpoint` shared config file parameter + S3UsEast1RegionalEndpoint *string `pulumi:"s3UsEast1RegionalEndpoint"` + // Set this to true to enable the request to use path-style addressing, i.e., https://s3.amazonaws.com/BUCKET/KEY. By + // default, the S3 client will use virtual hosted bucket addressing when possible (https://BUCKET.s3.amazonaws.com/KEY). + // Specific to the Amazon S3 service. + S3UsePathStyle *bool `pulumi:"s3UsePathStyle"` + // The secret key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console. + SecretKey *string `pulumi:"secretKey"` + // List of paths to shared config files. If not set, defaults to [~/.aws/config]. + SharedConfigFiles []string `pulumi:"sharedConfigFiles"` + // List of paths to shared credentials files. If not set, defaults to [~/.aws/credentials]. + SharedCredentialsFiles []string `pulumi:"sharedCredentialsFiles"` + // Skip the credentials validation via STS API. Used for AWS API implementations that do not have STS + // available/implemented. + SkipCredentialsValidation *bool `pulumi:"skipCredentialsValidation"` + // Skip the AWS Metadata API check. Used for AWS API implementations that do not have a metadata api endpoint. + SkipMetadataApiCheck *bool `pulumi:"skipMetadataApiCheck"` + // Skip static validation of region name. Used by users of alternative AWS-like APIs or users w/ access to regions that are + // not public (yet). + SkipRegionValidation *bool `pulumi:"skipRegionValidation"` + // Skip requesting the account ID. Used for AWS API implementations that do not have IAM/STS API and/or metadata API. + SkipRequestingAccountId *bool `pulumi:"skipRequestingAccountId"` + // The region where AWS STS operations will take place. Examples are us-east-1 and us-west-2. + StsRegion *string `pulumi:"stsRegion"` + // session token. A session token is only required if you are using temporary security credentials. + Token *string `pulumi:"token"` + // The capacity of the AWS SDK's token bucket rate limiter. + TokenBucketRateLimiterCapacity *int `pulumi:"tokenBucketRateLimiterCapacity"` + // Resolve an endpoint with DualStack capability + UseDualstackEndpoint *bool `pulumi:"useDualstackEndpoint"` + // Resolve an endpoint with FIPS capability + UseFipsEndpoint *bool `pulumi:"useFipsEndpoint"` +} + +// The set of arguments for constructing a Provider resource. +type ProviderArgs struct { + // The access key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console. + AccessKey pulumi.StringPtrInput + AllowedAccountIds pulumi.StringArrayInput + AssumeRole ProviderAssumeRolePtrInput + AssumeRoleWithWebIdentity ProviderAssumeRoleWithWebIdentityPtrInput + // File containing custom root and intermediate certificates. Can also be configured using the `AWS_CA_BUNDLE` environment + // variable. (Setting `caBundle` in the shared config file is not supported.) + CustomCaBundle pulumi.StringPtrInput + // Configuration block with settings to default resource tags across all resources. + DefaultTags ProviderDefaultTagsPtrInput + // Address of the EC2 metadata service endpoint to use. Can also be configured using the + // `AWS_EC2_METADATA_SERVICE_ENDPOINT` environment variable. + Ec2MetadataServiceEndpoint pulumi.StringPtrInput + // Protocol to use with EC2 metadata service endpoint.Valid values are `IPv4` and `IPv6`. Can also be configured using the + // `AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE` environment variable. + Ec2MetadataServiceEndpointMode pulumi.StringPtrInput + Endpoints ProviderEndpointArrayInput + ForbiddenAccountIds pulumi.StringArrayInput + // URL of a proxy to use for HTTP requests when accessing the AWS API. Can also be set using the `HTTP_PROXY` or + // `httpProxy` environment variables. + HttpProxy pulumi.StringPtrInput + // URL of a proxy to use for HTTPS requests when accessing the AWS API. Can also be set using the `HTTPS_PROXY` or + // `httpsProxy` environment variables. + HttpsProxy pulumi.StringPtrInput + // Configuration block with settings to ignore resource tags across all resources. + IgnoreTags ProviderIgnoreTagsPtrInput + // Explicitly allow the provider to perform "insecure" SSL requests. If omitted, default value is `false` + Insecure pulumi.BoolPtrInput + // The maximum number of times an AWS API request is being executed. If the API request still fails, an error is thrown. + MaxRetries pulumi.IntPtrInput + // Comma-separated list of hosts that should not use HTTP or HTTPS proxies. Can also be set using the `NO_PROXY` or + // `noProxy` environment variables. + NoProxy pulumi.StringPtrInput + // The profile for API operations. If not set, the default profile created with `aws configure` will be used. + Profile pulumi.StringPtrInput + // The region where AWS operations will take place. Examples are us-east-1, us-west-2, etc. + Region pulumi.StringPtrInput + // Specifies how retries are attempted. Valid values are `standard` and `adaptive`. Can also be configured using the + // `AWS_RETRY_MODE` environment variable. + RetryMode pulumi.StringPtrInput + // Specifies whether S3 API calls in the `us-east-1` region use the legacy global endpoint or a regional endpoint. Valid + // values are `legacy` or `regional`. Can also be configured using the `AWS_S3_US_EAST_1_REGIONAL_ENDPOINT` environment + // variable or the `s3UsEast1RegionalEndpoint` shared config file parameter + S3UsEast1RegionalEndpoint pulumi.StringPtrInput + // Set this to true to enable the request to use path-style addressing, i.e., https://s3.amazonaws.com/BUCKET/KEY. By + // default, the S3 client will use virtual hosted bucket addressing when possible (https://BUCKET.s3.amazonaws.com/KEY). + // Specific to the Amazon S3 service. + S3UsePathStyle pulumi.BoolPtrInput + // The secret key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console. + SecretKey pulumi.StringPtrInput + // List of paths to shared config files. If not set, defaults to [~/.aws/config]. + SharedConfigFiles pulumi.StringArrayInput + // List of paths to shared credentials files. If not set, defaults to [~/.aws/credentials]. + SharedCredentialsFiles pulumi.StringArrayInput + // Skip the credentials validation via STS API. Used for AWS API implementations that do not have STS + // available/implemented. + SkipCredentialsValidation pulumi.BoolPtrInput + // Skip the AWS Metadata API check. Used for AWS API implementations that do not have a metadata api endpoint. + SkipMetadataApiCheck pulumi.BoolPtrInput + // Skip static validation of region name. Used by users of alternative AWS-like APIs or users w/ access to regions that are + // not public (yet). + SkipRegionValidation pulumi.BoolPtrInput + // Skip requesting the account ID. Used for AWS API implementations that do not have IAM/STS API and/or metadata API. + SkipRequestingAccountId pulumi.BoolPtrInput + // The region where AWS STS operations will take place. Examples are us-east-1 and us-west-2. + StsRegion pulumi.StringPtrInput + // session token. A session token is only required if you are using temporary security credentials. + Token pulumi.StringPtrInput + // The capacity of the AWS SDK's token bucket rate limiter. + TokenBucketRateLimiterCapacity pulumi.IntPtrInput + // Resolve an endpoint with DualStack capability + UseDualstackEndpoint pulumi.BoolPtrInput + // Resolve an endpoint with FIPS capability + UseFipsEndpoint pulumi.BoolPtrInput +} + +func (ProviderArgs) ElementType() reflect.Type { + return reflect.TypeOf((*providerArgs)(nil)).Elem() +} + +type ProviderInput interface { + pulumi.Input + + ToProviderOutput() ProviderOutput + ToProviderOutputWithContext(ctx context.Context) ProviderOutput +} + +func (*Provider) ElementType() reflect.Type { + return reflect.TypeOf((**Provider)(nil)).Elem() +} + +func (i *Provider) ToProviderOutput() ProviderOutput { + return i.ToProviderOutputWithContext(context.Background()) +} + +func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput) +} + +type ProviderOutput struct{ *pulumi.OutputState } + +func (ProviderOutput) ElementType() reflect.Type { + return reflect.TypeOf((**Provider)(nil)).Elem() +} + +func (o ProviderOutput) ToProviderOutput() ProviderOutput { + return o +} + +func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { + return o +} + +// The access key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console. +func (o ProviderOutput) AccessKey() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.AccessKey }).(pulumi.StringPtrOutput) +} + +// File containing custom root and intermediate certificates. Can also be configured using the `AWS_CA_BUNDLE` environment +// variable. (Setting `caBundle` in the shared config file is not supported.) +func (o ProviderOutput) CustomCaBundle() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.CustomCaBundle }).(pulumi.StringPtrOutput) +} + +// Address of the EC2 metadata service endpoint to use. Can also be configured using the +// `AWS_EC2_METADATA_SERVICE_ENDPOINT` environment variable. +func (o ProviderOutput) Ec2MetadataServiceEndpoint() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Ec2MetadataServiceEndpoint }).(pulumi.StringPtrOutput) +} + +// Protocol to use with EC2 metadata service endpoint.Valid values are `IPv4` and `IPv6`. Can also be configured using the +// `AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE` environment variable. +func (o ProviderOutput) Ec2MetadataServiceEndpointMode() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Ec2MetadataServiceEndpointMode }).(pulumi.StringPtrOutput) +} + +// URL of a proxy to use for HTTP requests when accessing the AWS API. Can also be set using the `HTTP_PROXY` or +// `httpProxy` environment variables. +func (o ProviderOutput) HttpProxy() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.HttpProxy }).(pulumi.StringPtrOutput) +} + +// URL of a proxy to use for HTTPS requests when accessing the AWS API. Can also be set using the `HTTPS_PROXY` or +// `httpsProxy` environment variables. +func (o ProviderOutput) HttpsProxy() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.HttpsProxy }).(pulumi.StringPtrOutput) +} + +// Comma-separated list of hosts that should not use HTTP or HTTPS proxies. Can also be set using the `NO_PROXY` or +// `noProxy` environment variables. +func (o ProviderOutput) NoProxy() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.NoProxy }).(pulumi.StringPtrOutput) +} + +// The profile for API operations. If not set, the default profile created with `aws configure` will be used. +func (o ProviderOutput) Profile() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Profile }).(pulumi.StringPtrOutput) +} + +// The region where AWS operations will take place. Examples are us-east-1, us-west-2, etc. +func (o ProviderOutput) Region() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Region }).(pulumi.StringPtrOutput) +} + +// Specifies how retries are attempted. Valid values are `standard` and `adaptive`. Can also be configured using the +// `AWS_RETRY_MODE` environment variable. +func (o ProviderOutput) RetryMode() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.RetryMode }).(pulumi.StringPtrOutput) +} + +// Specifies whether S3 API calls in the `us-east-1` region use the legacy global endpoint or a regional endpoint. Valid +// values are `legacy` or `regional`. Can also be configured using the `AWS_S3_US_EAST_1_REGIONAL_ENDPOINT` environment +// variable or the `s3UsEast1RegionalEndpoint` shared config file parameter +func (o ProviderOutput) S3UsEast1RegionalEndpoint() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.S3UsEast1RegionalEndpoint }).(pulumi.StringPtrOutput) +} + +// The secret key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console. +func (o ProviderOutput) SecretKey() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.SecretKey }).(pulumi.StringPtrOutput) +} + +// The region where AWS STS operations will take place. Examples are us-east-1 and us-west-2. +func (o ProviderOutput) StsRegion() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.StsRegion }).(pulumi.StringPtrOutput) +} + +// session token. A session token is only required if you are using temporary security credentials. +func (o ProviderOutput) Token() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Provider) pulumi.StringPtrOutput { return v.Token }).(pulumi.StringPtrOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{}) + pulumi.RegisterOutputType(ProviderOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pulumi-plugin.json b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pulumi-plugin.json new file mode 100644 index 000000000..d7cbbb9f4 --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pulumi-plugin.json @@ -0,0 +1,5 @@ +{ + "resource": true, + "name": "aws", + "version": "6.80.0" +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pulumiEnums.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pulumiEnums.go new file mode 100644 index 000000000..dcd5a074e --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pulumiEnums.go @@ -0,0 +1,258 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// A Region represents any valid Amazon region that may be targeted with deployments. +type Region string + +const ( + RegionAFSouth1 = Region("af-south-1") + RegionAPEast1 = Region("ap-east-1") + RegionAPNortheast1 = Region("ap-northeast-1") + RegionAPNortheast2 = Region("ap-northeast-2") + RegionAPNortheast3 = Region("ap-northeast-3") + RegionAPSouth1 = Region("ap-south-1") + RegionAPSouth2 = Region("ap-south-2") + RegionAPSoutheast1 = Region("ap-southeast-1") + RegionAPSoutheast2 = Region("ap-southeast-2") + RegionAPSoutheast3 = Region("ap-southeast-3") + RegionAPSoutheast4 = Region("ap-southeast-4") + RegionAPSoutheast5 = Region("ap-southeast-5") + RegionAPSoutheast7 = Region("ap-southeast-7") + RegionCACentral = Region("ca-central-1") + RegionCAWest1 = Region("ca-west-1") + RegionEUCentral1 = Region("eu-central-1") + RegionEUCentral2 = Region("eu-central-2") + RegionEUNorth1 = Region("eu-north-1") + RegionEUSouth1 = Region("eu-south-1") + RegionEUSouth2 = Region("eu-south-2") + RegionEUWest1 = Region("eu-west-1") + RegionEUWest2 = Region("eu-west-2") + RegionEUWest3 = Region("eu-west-3") + RegionILCentral1 = Region("il-central-1") + RegionMECentral1 = Region("me-central-1") + RegionMESouth1 = Region("me-south-1") + RegionSAEast1 = Region("sa-east-1") + RegionUSEast1 = Region("us-east-1") + RegionUSEast2 = Region("us-east-2") + RegionUSWest1 = Region("us-west-1") + RegionUSWest2 = Region("us-west-2") + RegionCNNorth1 = Region("cn-north-1") + RegionCNNorthwest1 = Region("cn-northwest-1") + RegionUSGovEast1 = Region("us-gov-east-1") + RegionUSGovWest1 = Region("us-gov-west-1") + RegionUSISOEast1 = Region("us-iso-east-1") + RegionUSISOWest1 = Region("us-iso-west-1") + RegionUSISOBEast1 = Region("us-isob-east-1") + RegionEUISOEWest1 = Region("eu-isoe-west-1") +) + +func (Region) ElementType() reflect.Type { + return reflect.TypeOf((*Region)(nil)).Elem() +} + +func (e Region) ToRegionOutput() RegionOutput { + return pulumi.ToOutput(e).(RegionOutput) +} + +func (e Region) ToRegionOutputWithContext(ctx context.Context) RegionOutput { + return pulumi.ToOutputWithContext(ctx, e).(RegionOutput) +} + +func (e Region) ToRegionPtrOutput() RegionPtrOutput { + return e.ToRegionPtrOutputWithContext(context.Background()) +} + +func (e Region) ToRegionPtrOutputWithContext(ctx context.Context) RegionPtrOutput { + return Region(e).ToRegionOutputWithContext(ctx).ToRegionPtrOutputWithContext(ctx) +} + +func (e Region) ToStringOutput() pulumi.StringOutput { + return pulumi.ToOutput(pulumi.String(e)).(pulumi.StringOutput) +} + +func (e Region) ToStringOutputWithContext(ctx context.Context) pulumi.StringOutput { + return pulumi.ToOutputWithContext(ctx, pulumi.String(e)).(pulumi.StringOutput) +} + +func (e Region) ToStringPtrOutput() pulumi.StringPtrOutput { + return pulumi.String(e).ToStringPtrOutputWithContext(context.Background()) +} + +func (e Region) ToStringPtrOutputWithContext(ctx context.Context) pulumi.StringPtrOutput { + return pulumi.String(e).ToStringOutputWithContext(ctx).ToStringPtrOutputWithContext(ctx) +} + +type RegionOutput struct{ *pulumi.OutputState } + +func (RegionOutput) ElementType() reflect.Type { + return reflect.TypeOf((*Region)(nil)).Elem() +} + +func (o RegionOutput) ToRegionOutput() RegionOutput { + return o +} + +func (o RegionOutput) ToRegionOutputWithContext(ctx context.Context) RegionOutput { + return o +} + +func (o RegionOutput) ToRegionPtrOutput() RegionPtrOutput { + return o.ToRegionPtrOutputWithContext(context.Background()) +} + +func (o RegionOutput) ToRegionPtrOutputWithContext(ctx context.Context) RegionPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v Region) *Region { + return &v + }).(RegionPtrOutput) +} + +func (o RegionOutput) ToStringOutput() pulumi.StringOutput { + return o.ToStringOutputWithContext(context.Background()) +} + +func (o RegionOutput) ToStringOutputWithContext(ctx context.Context) pulumi.StringOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, e Region) string { + return string(e) + }).(pulumi.StringOutput) +} + +func (o RegionOutput) ToStringPtrOutput() pulumi.StringPtrOutput { + return o.ToStringPtrOutputWithContext(context.Background()) +} + +func (o RegionOutput) ToStringPtrOutputWithContext(ctx context.Context) pulumi.StringPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, e Region) *string { + v := string(e) + return &v + }).(pulumi.StringPtrOutput) +} + +type RegionPtrOutput struct{ *pulumi.OutputState } + +func (RegionPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**Region)(nil)).Elem() +} + +func (o RegionPtrOutput) ToRegionPtrOutput() RegionPtrOutput { + return o +} + +func (o RegionPtrOutput) ToRegionPtrOutputWithContext(ctx context.Context) RegionPtrOutput { + return o +} + +func (o RegionPtrOutput) Elem() RegionOutput { + return o.ApplyT(func(v *Region) Region { + if v != nil { + return *v + } + var ret Region + return ret + }).(RegionOutput) +} + +func (o RegionPtrOutput) ToStringPtrOutput() pulumi.StringPtrOutput { + return o.ToStringPtrOutputWithContext(context.Background()) +} + +func (o RegionPtrOutput) ToStringPtrOutputWithContext(ctx context.Context) pulumi.StringPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, e *Region) *string { + if e == nil { + return nil + } + v := string(*e) + return &v + }).(pulumi.StringPtrOutput) +} + +// RegionInput is an input type that accepts values of the Region enum +// A concrete instance of `RegionInput` can be one of the following: +// +// RegionAFSouth1 +// RegionAPEast1 +// RegionAPNortheast1 +// RegionAPNortheast2 +// RegionAPNortheast3 +// RegionAPSouth1 +// RegionAPSouth2 +// RegionAPSoutheast1 +// RegionAPSoutheast2 +// RegionAPSoutheast3 +// RegionAPSoutheast4 +// RegionAPSoutheast5 +// RegionAPSoutheast7 +// RegionCACentral +// RegionCAWest1 +// RegionEUCentral1 +// RegionEUCentral2 +// RegionEUNorth1 +// RegionEUSouth1 +// RegionEUSouth2 +// RegionEUWest1 +// RegionEUWest2 +// RegionEUWest3 +// RegionILCentral1 +// RegionMECentral1 +// RegionMESouth1 +// RegionSAEast1 +// RegionUSEast1 +// RegionUSEast2 +// RegionUSWest1 +// RegionUSWest2 +// RegionCNNorth1 +// RegionCNNorthwest1 +// RegionUSGovEast1 +// RegionUSGovWest1 +// RegionUSISOEast1 +// RegionUSISOWest1 +// RegionUSISOBEast1 +// RegionEUISOEWest1 +type RegionInput interface { + pulumi.Input + + ToRegionOutput() RegionOutput + ToRegionOutputWithContext(context.Context) RegionOutput +} + +var regionPtrType = reflect.TypeOf((**Region)(nil)).Elem() + +type RegionPtrInput interface { + pulumi.Input + + ToRegionPtrOutput() RegionPtrOutput + ToRegionPtrOutputWithContext(context.Context) RegionPtrOutput +} + +type regionPtr string + +func RegionPtr(v string) RegionPtrInput { + return (*regionPtr)(&v) +} + +func (*regionPtr) ElementType() reflect.Type { + return regionPtrType +} + +func (in *regionPtr) ToRegionPtrOutput() RegionPtrOutput { + return pulumi.ToOutput(in).(RegionPtrOutput) +} + +func (in *regionPtr) ToRegionPtrOutputWithContext(ctx context.Context) RegionPtrOutput { + return pulumi.ToOutputWithContext(ctx, in).(RegionPtrOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*RegionInput)(nil)).Elem(), Region("af-south-1")) + pulumi.RegisterInputType(reflect.TypeOf((*RegionPtrInput)(nil)).Elem(), Region("af-south-1")) + pulumi.RegisterOutputType(RegionOutput{}) + pulumi.RegisterOutputType(RegionPtrOutput{}) +} diff --git a/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pulumiTypes.go b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pulumiTypes.go new file mode 100644 index 000000000..c32d7bd3a --- /dev/null +++ b/vendor/github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pulumiTypes.go @@ -0,0 +1,3980 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package aws + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +var _ = internal.GetEnvOrDefault + +type ProviderAssumeRole struct { + // The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m. + Duration *string `pulumi:"duration"` + // A unique identifier that might be required when you assume a role in another account. + ExternalId *string `pulumi:"externalId"` + // IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. + Policy *string `pulumi:"policy"` + // Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. + PolicyArns []string `pulumi:"policyArns"` + // Amazon Resource Name (ARN) of an IAM Role to assume prior to making API calls. + RoleArn *string `pulumi:"roleArn"` + // An identifier for the assumed role session. + SessionName *string `pulumi:"sessionName"` + // Source identity specified by the principal assuming the role. + SourceIdentity *string `pulumi:"sourceIdentity"` + // Assume role session tags. + Tags map[string]string `pulumi:"tags"` + // Assume role session tag keys to pass to any subsequent sessions. + TransitiveTagKeys []string `pulumi:"transitiveTagKeys"` +} + +// ProviderAssumeRoleInput is an input type that accepts ProviderAssumeRoleArgs and ProviderAssumeRoleOutput values. +// You can construct a concrete instance of `ProviderAssumeRoleInput` via: +// +// ProviderAssumeRoleArgs{...} +type ProviderAssumeRoleInput interface { + pulumi.Input + + ToProviderAssumeRoleOutput() ProviderAssumeRoleOutput + ToProviderAssumeRoleOutputWithContext(context.Context) ProviderAssumeRoleOutput +} + +type ProviderAssumeRoleArgs struct { + // The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m. + Duration pulumi.StringPtrInput `pulumi:"duration"` + // A unique identifier that might be required when you assume a role in another account. + ExternalId pulumi.StringPtrInput `pulumi:"externalId"` + // IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. + Policy pulumi.StringPtrInput `pulumi:"policy"` + // Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. + PolicyArns pulumi.StringArrayInput `pulumi:"policyArns"` + // Amazon Resource Name (ARN) of an IAM Role to assume prior to making API calls. + RoleArn pulumi.StringPtrInput `pulumi:"roleArn"` + // An identifier for the assumed role session. + SessionName pulumi.StringPtrInput `pulumi:"sessionName"` + // Source identity specified by the principal assuming the role. + SourceIdentity pulumi.StringPtrInput `pulumi:"sourceIdentity"` + // Assume role session tags. + Tags pulumi.StringMapInput `pulumi:"tags"` + // Assume role session tag keys to pass to any subsequent sessions. + TransitiveTagKeys pulumi.StringArrayInput `pulumi:"transitiveTagKeys"` +} + +func (ProviderAssumeRoleArgs) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderAssumeRole)(nil)).Elem() +} + +func (i ProviderAssumeRoleArgs) ToProviderAssumeRoleOutput() ProviderAssumeRoleOutput { + return i.ToProviderAssumeRoleOutputWithContext(context.Background()) +} + +func (i ProviderAssumeRoleArgs) ToProviderAssumeRoleOutputWithContext(ctx context.Context) ProviderAssumeRoleOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderAssumeRoleOutput) +} + +func (i ProviderAssumeRoleArgs) ToProviderAssumeRolePtrOutput() ProviderAssumeRolePtrOutput { + return i.ToProviderAssumeRolePtrOutputWithContext(context.Background()) +} + +func (i ProviderAssumeRoleArgs) ToProviderAssumeRolePtrOutputWithContext(ctx context.Context) ProviderAssumeRolePtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderAssumeRoleOutput).ToProviderAssumeRolePtrOutputWithContext(ctx) +} + +// ProviderAssumeRolePtrInput is an input type that accepts ProviderAssumeRoleArgs, ProviderAssumeRolePtr and ProviderAssumeRolePtrOutput values. +// You can construct a concrete instance of `ProviderAssumeRolePtrInput` via: +// +// ProviderAssumeRoleArgs{...} +// +// or: +// +// nil +type ProviderAssumeRolePtrInput interface { + pulumi.Input + + ToProviderAssumeRolePtrOutput() ProviderAssumeRolePtrOutput + ToProviderAssumeRolePtrOutputWithContext(context.Context) ProviderAssumeRolePtrOutput +} + +type providerAssumeRolePtrType ProviderAssumeRoleArgs + +func ProviderAssumeRolePtr(v *ProviderAssumeRoleArgs) ProviderAssumeRolePtrInput { + return (*providerAssumeRolePtrType)(v) +} + +func (*providerAssumeRolePtrType) ElementType() reflect.Type { + return reflect.TypeOf((**ProviderAssumeRole)(nil)).Elem() +} + +func (i *providerAssumeRolePtrType) ToProviderAssumeRolePtrOutput() ProviderAssumeRolePtrOutput { + return i.ToProviderAssumeRolePtrOutputWithContext(context.Background()) +} + +func (i *providerAssumeRolePtrType) ToProviderAssumeRolePtrOutputWithContext(ctx context.Context) ProviderAssumeRolePtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderAssumeRolePtrOutput) +} + +type ProviderAssumeRoleOutput struct{ *pulumi.OutputState } + +func (ProviderAssumeRoleOutput) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderAssumeRole)(nil)).Elem() +} + +func (o ProviderAssumeRoleOutput) ToProviderAssumeRoleOutput() ProviderAssumeRoleOutput { + return o +} + +func (o ProviderAssumeRoleOutput) ToProviderAssumeRoleOutputWithContext(ctx context.Context) ProviderAssumeRoleOutput { + return o +} + +func (o ProviderAssumeRoleOutput) ToProviderAssumeRolePtrOutput() ProviderAssumeRolePtrOutput { + return o.ToProviderAssumeRolePtrOutputWithContext(context.Background()) +} + +func (o ProviderAssumeRoleOutput) ToProviderAssumeRolePtrOutputWithContext(ctx context.Context) ProviderAssumeRolePtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v ProviderAssumeRole) *ProviderAssumeRole { + return &v + }).(ProviderAssumeRolePtrOutput) +} + +// The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m. +func (o ProviderAssumeRoleOutput) Duration() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRole) *string { return v.Duration }).(pulumi.StringPtrOutput) +} + +// A unique identifier that might be required when you assume a role in another account. +func (o ProviderAssumeRoleOutput) ExternalId() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRole) *string { return v.ExternalId }).(pulumi.StringPtrOutput) +} + +// IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. +func (o ProviderAssumeRoleOutput) Policy() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRole) *string { return v.Policy }).(pulumi.StringPtrOutput) +} + +// Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. +func (o ProviderAssumeRoleOutput) PolicyArns() pulumi.StringArrayOutput { + return o.ApplyT(func(v ProviderAssumeRole) []string { return v.PolicyArns }).(pulumi.StringArrayOutput) +} + +// Amazon Resource Name (ARN) of an IAM Role to assume prior to making API calls. +func (o ProviderAssumeRoleOutput) RoleArn() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRole) *string { return v.RoleArn }).(pulumi.StringPtrOutput) +} + +// An identifier for the assumed role session. +func (o ProviderAssumeRoleOutput) SessionName() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRole) *string { return v.SessionName }).(pulumi.StringPtrOutput) +} + +// Source identity specified by the principal assuming the role. +func (o ProviderAssumeRoleOutput) SourceIdentity() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRole) *string { return v.SourceIdentity }).(pulumi.StringPtrOutput) +} + +// Assume role session tags. +func (o ProviderAssumeRoleOutput) Tags() pulumi.StringMapOutput { + return o.ApplyT(func(v ProviderAssumeRole) map[string]string { return v.Tags }).(pulumi.StringMapOutput) +} + +// Assume role session tag keys to pass to any subsequent sessions. +func (o ProviderAssumeRoleOutput) TransitiveTagKeys() pulumi.StringArrayOutput { + return o.ApplyT(func(v ProviderAssumeRole) []string { return v.TransitiveTagKeys }).(pulumi.StringArrayOutput) +} + +type ProviderAssumeRolePtrOutput struct{ *pulumi.OutputState } + +func (ProviderAssumeRolePtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**ProviderAssumeRole)(nil)).Elem() +} + +func (o ProviderAssumeRolePtrOutput) ToProviderAssumeRolePtrOutput() ProviderAssumeRolePtrOutput { + return o +} + +func (o ProviderAssumeRolePtrOutput) ToProviderAssumeRolePtrOutputWithContext(ctx context.Context) ProviderAssumeRolePtrOutput { + return o +} + +func (o ProviderAssumeRolePtrOutput) Elem() ProviderAssumeRoleOutput { + return o.ApplyT(func(v *ProviderAssumeRole) ProviderAssumeRole { + if v != nil { + return *v + } + var ret ProviderAssumeRole + return ret + }).(ProviderAssumeRoleOutput) +} + +// The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m. +func (o ProviderAssumeRolePtrOutput) Duration() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRole) *string { + if v == nil { + return nil + } + return v.Duration + }).(pulumi.StringPtrOutput) +} + +// A unique identifier that might be required when you assume a role in another account. +func (o ProviderAssumeRolePtrOutput) ExternalId() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRole) *string { + if v == nil { + return nil + } + return v.ExternalId + }).(pulumi.StringPtrOutput) +} + +// IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. +func (o ProviderAssumeRolePtrOutput) Policy() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRole) *string { + if v == nil { + return nil + } + return v.Policy + }).(pulumi.StringPtrOutput) +} + +// Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. +func (o ProviderAssumeRolePtrOutput) PolicyArns() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ProviderAssumeRole) []string { + if v == nil { + return nil + } + return v.PolicyArns + }).(pulumi.StringArrayOutput) +} + +// Amazon Resource Name (ARN) of an IAM Role to assume prior to making API calls. +func (o ProviderAssumeRolePtrOutput) RoleArn() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRole) *string { + if v == nil { + return nil + } + return v.RoleArn + }).(pulumi.StringPtrOutput) +} + +// An identifier for the assumed role session. +func (o ProviderAssumeRolePtrOutput) SessionName() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRole) *string { + if v == nil { + return nil + } + return v.SessionName + }).(pulumi.StringPtrOutput) +} + +// Source identity specified by the principal assuming the role. +func (o ProviderAssumeRolePtrOutput) SourceIdentity() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRole) *string { + if v == nil { + return nil + } + return v.SourceIdentity + }).(pulumi.StringPtrOutput) +} + +// Assume role session tags. +func (o ProviderAssumeRolePtrOutput) Tags() pulumi.StringMapOutput { + return o.ApplyT(func(v *ProviderAssumeRole) map[string]string { + if v == nil { + return nil + } + return v.Tags + }).(pulumi.StringMapOutput) +} + +// Assume role session tag keys to pass to any subsequent sessions. +func (o ProviderAssumeRolePtrOutput) TransitiveTagKeys() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ProviderAssumeRole) []string { + if v == nil { + return nil + } + return v.TransitiveTagKeys + }).(pulumi.StringArrayOutput) +} + +type ProviderAssumeRoleWithWebIdentity struct { + // The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m. + Duration *string `pulumi:"duration"` + // IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. + Policy *string `pulumi:"policy"` + // Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. + PolicyArns []string `pulumi:"policyArns"` + // Amazon Resource Name (ARN) of an IAM Role to assume prior to making API calls. + RoleArn *string `pulumi:"roleArn"` + // An identifier for the assumed role session. + SessionName *string `pulumi:"sessionName"` + WebIdentityToken *string `pulumi:"webIdentityToken"` + WebIdentityTokenFile *string `pulumi:"webIdentityTokenFile"` +} + +// ProviderAssumeRoleWithWebIdentityInput is an input type that accepts ProviderAssumeRoleWithWebIdentityArgs and ProviderAssumeRoleWithWebIdentityOutput values. +// You can construct a concrete instance of `ProviderAssumeRoleWithWebIdentityInput` via: +// +// ProviderAssumeRoleWithWebIdentityArgs{...} +type ProviderAssumeRoleWithWebIdentityInput interface { + pulumi.Input + + ToProviderAssumeRoleWithWebIdentityOutput() ProviderAssumeRoleWithWebIdentityOutput + ToProviderAssumeRoleWithWebIdentityOutputWithContext(context.Context) ProviderAssumeRoleWithWebIdentityOutput +} + +type ProviderAssumeRoleWithWebIdentityArgs struct { + // The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m. + Duration pulumi.StringPtrInput `pulumi:"duration"` + // IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. + Policy pulumi.StringPtrInput `pulumi:"policy"` + // Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. + PolicyArns pulumi.StringArrayInput `pulumi:"policyArns"` + // Amazon Resource Name (ARN) of an IAM Role to assume prior to making API calls. + RoleArn pulumi.StringPtrInput `pulumi:"roleArn"` + // An identifier for the assumed role session. + SessionName pulumi.StringPtrInput `pulumi:"sessionName"` + WebIdentityToken pulumi.StringPtrInput `pulumi:"webIdentityToken"` + WebIdentityTokenFile pulumi.StringPtrInput `pulumi:"webIdentityTokenFile"` +} + +func (ProviderAssumeRoleWithWebIdentityArgs) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderAssumeRoleWithWebIdentity)(nil)).Elem() +} + +func (i ProviderAssumeRoleWithWebIdentityArgs) ToProviderAssumeRoleWithWebIdentityOutput() ProviderAssumeRoleWithWebIdentityOutput { + return i.ToProviderAssumeRoleWithWebIdentityOutputWithContext(context.Background()) +} + +func (i ProviderAssumeRoleWithWebIdentityArgs) ToProviderAssumeRoleWithWebIdentityOutputWithContext(ctx context.Context) ProviderAssumeRoleWithWebIdentityOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderAssumeRoleWithWebIdentityOutput) +} + +func (i ProviderAssumeRoleWithWebIdentityArgs) ToProviderAssumeRoleWithWebIdentityPtrOutput() ProviderAssumeRoleWithWebIdentityPtrOutput { + return i.ToProviderAssumeRoleWithWebIdentityPtrOutputWithContext(context.Background()) +} + +func (i ProviderAssumeRoleWithWebIdentityArgs) ToProviderAssumeRoleWithWebIdentityPtrOutputWithContext(ctx context.Context) ProviderAssumeRoleWithWebIdentityPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderAssumeRoleWithWebIdentityOutput).ToProviderAssumeRoleWithWebIdentityPtrOutputWithContext(ctx) +} + +// ProviderAssumeRoleWithWebIdentityPtrInput is an input type that accepts ProviderAssumeRoleWithWebIdentityArgs, ProviderAssumeRoleWithWebIdentityPtr and ProviderAssumeRoleWithWebIdentityPtrOutput values. +// You can construct a concrete instance of `ProviderAssumeRoleWithWebIdentityPtrInput` via: +// +// ProviderAssumeRoleWithWebIdentityArgs{...} +// +// or: +// +// nil +type ProviderAssumeRoleWithWebIdentityPtrInput interface { + pulumi.Input + + ToProviderAssumeRoleWithWebIdentityPtrOutput() ProviderAssumeRoleWithWebIdentityPtrOutput + ToProviderAssumeRoleWithWebIdentityPtrOutputWithContext(context.Context) ProviderAssumeRoleWithWebIdentityPtrOutput +} + +type providerAssumeRoleWithWebIdentityPtrType ProviderAssumeRoleWithWebIdentityArgs + +func ProviderAssumeRoleWithWebIdentityPtr(v *ProviderAssumeRoleWithWebIdentityArgs) ProviderAssumeRoleWithWebIdentityPtrInput { + return (*providerAssumeRoleWithWebIdentityPtrType)(v) +} + +func (*providerAssumeRoleWithWebIdentityPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**ProviderAssumeRoleWithWebIdentity)(nil)).Elem() +} + +func (i *providerAssumeRoleWithWebIdentityPtrType) ToProviderAssumeRoleWithWebIdentityPtrOutput() ProviderAssumeRoleWithWebIdentityPtrOutput { + return i.ToProviderAssumeRoleWithWebIdentityPtrOutputWithContext(context.Background()) +} + +func (i *providerAssumeRoleWithWebIdentityPtrType) ToProviderAssumeRoleWithWebIdentityPtrOutputWithContext(ctx context.Context) ProviderAssumeRoleWithWebIdentityPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderAssumeRoleWithWebIdentityPtrOutput) +} + +type ProviderAssumeRoleWithWebIdentityOutput struct{ *pulumi.OutputState } + +func (ProviderAssumeRoleWithWebIdentityOutput) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderAssumeRoleWithWebIdentity)(nil)).Elem() +} + +func (o ProviderAssumeRoleWithWebIdentityOutput) ToProviderAssumeRoleWithWebIdentityOutput() ProviderAssumeRoleWithWebIdentityOutput { + return o +} + +func (o ProviderAssumeRoleWithWebIdentityOutput) ToProviderAssumeRoleWithWebIdentityOutputWithContext(ctx context.Context) ProviderAssumeRoleWithWebIdentityOutput { + return o +} + +func (o ProviderAssumeRoleWithWebIdentityOutput) ToProviderAssumeRoleWithWebIdentityPtrOutput() ProviderAssumeRoleWithWebIdentityPtrOutput { + return o.ToProviderAssumeRoleWithWebIdentityPtrOutputWithContext(context.Background()) +} + +func (o ProviderAssumeRoleWithWebIdentityOutput) ToProviderAssumeRoleWithWebIdentityPtrOutputWithContext(ctx context.Context) ProviderAssumeRoleWithWebIdentityPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v ProviderAssumeRoleWithWebIdentity) *ProviderAssumeRoleWithWebIdentity { + return &v + }).(ProviderAssumeRoleWithWebIdentityPtrOutput) +} + +// The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m. +func (o ProviderAssumeRoleWithWebIdentityOutput) Duration() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRoleWithWebIdentity) *string { return v.Duration }).(pulumi.StringPtrOutput) +} + +// IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. +func (o ProviderAssumeRoleWithWebIdentityOutput) Policy() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRoleWithWebIdentity) *string { return v.Policy }).(pulumi.StringPtrOutput) +} + +// Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. +func (o ProviderAssumeRoleWithWebIdentityOutput) PolicyArns() pulumi.StringArrayOutput { + return o.ApplyT(func(v ProviderAssumeRoleWithWebIdentity) []string { return v.PolicyArns }).(pulumi.StringArrayOutput) +} + +// Amazon Resource Name (ARN) of an IAM Role to assume prior to making API calls. +func (o ProviderAssumeRoleWithWebIdentityOutput) RoleArn() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRoleWithWebIdentity) *string { return v.RoleArn }).(pulumi.StringPtrOutput) +} + +// An identifier for the assumed role session. +func (o ProviderAssumeRoleWithWebIdentityOutput) SessionName() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRoleWithWebIdentity) *string { return v.SessionName }).(pulumi.StringPtrOutput) +} + +func (o ProviderAssumeRoleWithWebIdentityOutput) WebIdentityToken() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRoleWithWebIdentity) *string { return v.WebIdentityToken }).(pulumi.StringPtrOutput) +} + +func (o ProviderAssumeRoleWithWebIdentityOutput) WebIdentityTokenFile() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderAssumeRoleWithWebIdentity) *string { return v.WebIdentityTokenFile }).(pulumi.StringPtrOutput) +} + +type ProviderAssumeRoleWithWebIdentityPtrOutput struct{ *pulumi.OutputState } + +func (ProviderAssumeRoleWithWebIdentityPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**ProviderAssumeRoleWithWebIdentity)(nil)).Elem() +} + +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) ToProviderAssumeRoleWithWebIdentityPtrOutput() ProviderAssumeRoleWithWebIdentityPtrOutput { + return o +} + +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) ToProviderAssumeRoleWithWebIdentityPtrOutputWithContext(ctx context.Context) ProviderAssumeRoleWithWebIdentityPtrOutput { + return o +} + +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) Elem() ProviderAssumeRoleWithWebIdentityOutput { + return o.ApplyT(func(v *ProviderAssumeRoleWithWebIdentity) ProviderAssumeRoleWithWebIdentity { + if v != nil { + return *v + } + var ret ProviderAssumeRoleWithWebIdentity + return ret + }).(ProviderAssumeRoleWithWebIdentityOutput) +} + +// The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m. +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) Duration() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRoleWithWebIdentity) *string { + if v == nil { + return nil + } + return v.Duration + }).(pulumi.StringPtrOutput) +} + +// IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) Policy() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRoleWithWebIdentity) *string { + if v == nil { + return nil + } + return v.Policy + }).(pulumi.StringPtrOutput) +} + +// Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) PolicyArns() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ProviderAssumeRoleWithWebIdentity) []string { + if v == nil { + return nil + } + return v.PolicyArns + }).(pulumi.StringArrayOutput) +} + +// Amazon Resource Name (ARN) of an IAM Role to assume prior to making API calls. +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) RoleArn() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRoleWithWebIdentity) *string { + if v == nil { + return nil + } + return v.RoleArn + }).(pulumi.StringPtrOutput) +} + +// An identifier for the assumed role session. +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) SessionName() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRoleWithWebIdentity) *string { + if v == nil { + return nil + } + return v.SessionName + }).(pulumi.StringPtrOutput) +} + +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) WebIdentityToken() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRoleWithWebIdentity) *string { + if v == nil { + return nil + } + return v.WebIdentityToken + }).(pulumi.StringPtrOutput) +} + +func (o ProviderAssumeRoleWithWebIdentityPtrOutput) WebIdentityTokenFile() pulumi.StringPtrOutput { + return o.ApplyT(func(v *ProviderAssumeRoleWithWebIdentity) *string { + if v == nil { + return nil + } + return v.WebIdentityTokenFile + }).(pulumi.StringPtrOutput) +} + +type ProviderDefaultTags struct { + // Resource tags to default across all resources. Can also be configured with environment variables like `TF_AWS_DEFAULT_TAGS_`. + Tags map[string]string `pulumi:"tags"` +} + +// ProviderDefaultTagsInput is an input type that accepts ProviderDefaultTagsArgs and ProviderDefaultTagsOutput values. +// You can construct a concrete instance of `ProviderDefaultTagsInput` via: +// +// ProviderDefaultTagsArgs{...} +type ProviderDefaultTagsInput interface { + pulumi.Input + + ToProviderDefaultTagsOutput() ProviderDefaultTagsOutput + ToProviderDefaultTagsOutputWithContext(context.Context) ProviderDefaultTagsOutput +} + +type ProviderDefaultTagsArgs struct { + // Resource tags to default across all resources. Can also be configured with environment variables like `TF_AWS_DEFAULT_TAGS_`. + Tags pulumi.StringMapInput `pulumi:"tags"` +} + +func (ProviderDefaultTagsArgs) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderDefaultTags)(nil)).Elem() +} + +func (i ProviderDefaultTagsArgs) ToProviderDefaultTagsOutput() ProviderDefaultTagsOutput { + return i.ToProviderDefaultTagsOutputWithContext(context.Background()) +} + +func (i ProviderDefaultTagsArgs) ToProviderDefaultTagsOutputWithContext(ctx context.Context) ProviderDefaultTagsOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderDefaultTagsOutput) +} + +func (i ProviderDefaultTagsArgs) ToProviderDefaultTagsPtrOutput() ProviderDefaultTagsPtrOutput { + return i.ToProviderDefaultTagsPtrOutputWithContext(context.Background()) +} + +func (i ProviderDefaultTagsArgs) ToProviderDefaultTagsPtrOutputWithContext(ctx context.Context) ProviderDefaultTagsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderDefaultTagsOutput).ToProviderDefaultTagsPtrOutputWithContext(ctx) +} + +// ProviderDefaultTagsPtrInput is an input type that accepts ProviderDefaultTagsArgs, ProviderDefaultTagsPtr and ProviderDefaultTagsPtrOutput values. +// You can construct a concrete instance of `ProviderDefaultTagsPtrInput` via: +// +// ProviderDefaultTagsArgs{...} +// +// or: +// +// nil +type ProviderDefaultTagsPtrInput interface { + pulumi.Input + + ToProviderDefaultTagsPtrOutput() ProviderDefaultTagsPtrOutput + ToProviderDefaultTagsPtrOutputWithContext(context.Context) ProviderDefaultTagsPtrOutput +} + +type providerDefaultTagsPtrType ProviderDefaultTagsArgs + +func ProviderDefaultTagsPtr(v *ProviderDefaultTagsArgs) ProviderDefaultTagsPtrInput { + return (*providerDefaultTagsPtrType)(v) +} + +func (*providerDefaultTagsPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**ProviderDefaultTags)(nil)).Elem() +} + +func (i *providerDefaultTagsPtrType) ToProviderDefaultTagsPtrOutput() ProviderDefaultTagsPtrOutput { + return i.ToProviderDefaultTagsPtrOutputWithContext(context.Background()) +} + +func (i *providerDefaultTagsPtrType) ToProviderDefaultTagsPtrOutputWithContext(ctx context.Context) ProviderDefaultTagsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderDefaultTagsPtrOutput) +} + +type ProviderDefaultTagsOutput struct{ *pulumi.OutputState } + +func (ProviderDefaultTagsOutput) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderDefaultTags)(nil)).Elem() +} + +func (o ProviderDefaultTagsOutput) ToProviderDefaultTagsOutput() ProviderDefaultTagsOutput { + return o +} + +func (o ProviderDefaultTagsOutput) ToProviderDefaultTagsOutputWithContext(ctx context.Context) ProviderDefaultTagsOutput { + return o +} + +func (o ProviderDefaultTagsOutput) ToProviderDefaultTagsPtrOutput() ProviderDefaultTagsPtrOutput { + return o.ToProviderDefaultTagsPtrOutputWithContext(context.Background()) +} + +func (o ProviderDefaultTagsOutput) ToProviderDefaultTagsPtrOutputWithContext(ctx context.Context) ProviderDefaultTagsPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v ProviderDefaultTags) *ProviderDefaultTags { + return &v + }).(ProviderDefaultTagsPtrOutput) +} + +// Resource tags to default across all resources. Can also be configured with environment variables like `TF_AWS_DEFAULT_TAGS_`. +func (o ProviderDefaultTagsOutput) Tags() pulumi.StringMapOutput { + return o.ApplyT(func(v ProviderDefaultTags) map[string]string { return v.Tags }).(pulumi.StringMapOutput) +} + +type ProviderDefaultTagsPtrOutput struct{ *pulumi.OutputState } + +func (ProviderDefaultTagsPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**ProviderDefaultTags)(nil)).Elem() +} + +func (o ProviderDefaultTagsPtrOutput) ToProviderDefaultTagsPtrOutput() ProviderDefaultTagsPtrOutput { + return o +} + +func (o ProviderDefaultTagsPtrOutput) ToProviderDefaultTagsPtrOutputWithContext(ctx context.Context) ProviderDefaultTagsPtrOutput { + return o +} + +func (o ProviderDefaultTagsPtrOutput) Elem() ProviderDefaultTagsOutput { + return o.ApplyT(func(v *ProviderDefaultTags) ProviderDefaultTags { + if v != nil { + return *v + } + var ret ProviderDefaultTags + return ret + }).(ProviderDefaultTagsOutput) +} + +// Resource tags to default across all resources. Can also be configured with environment variables like `TF_AWS_DEFAULT_TAGS_`. +func (o ProviderDefaultTagsPtrOutput) Tags() pulumi.StringMapOutput { + return o.ApplyT(func(v *ProviderDefaultTags) map[string]string { + if v == nil { + return nil + } + return v.Tags + }).(pulumi.StringMapOutput) +} + +type ProviderEndpoint struct { + // Use this to override the default service endpoint URL + Accessanalyzer *string `pulumi:"accessanalyzer"` + // Use this to override the default service endpoint URL + Account *string `pulumi:"account"` + // Use this to override the default service endpoint URL + Acm *string `pulumi:"acm"` + // Use this to override the default service endpoint URL + Acmpca *string `pulumi:"acmpca"` + // Use this to override the default service endpoint URL + Amg *string `pulumi:"amg"` + // Use this to override the default service endpoint URL + Amp *string `pulumi:"amp"` + // Use this to override the default service endpoint URL + Amplify *string `pulumi:"amplify"` + // Use this to override the default service endpoint URL + Apigateway *string `pulumi:"apigateway"` + // Use this to override the default service endpoint URL + Apigatewayv2 *string `pulumi:"apigatewayv2"` + // Use this to override the default service endpoint URL + Appautoscaling *string `pulumi:"appautoscaling"` + // Use this to override the default service endpoint URL + Appconfig *string `pulumi:"appconfig"` + // Use this to override the default service endpoint URL + Appfabric *string `pulumi:"appfabric"` + // Use this to override the default service endpoint URL + Appflow *string `pulumi:"appflow"` + // Use this to override the default service endpoint URL + Appintegrations *string `pulumi:"appintegrations"` + // Use this to override the default service endpoint URL + Appintegrationsservice *string `pulumi:"appintegrationsservice"` + // Use this to override the default service endpoint URL + Applicationautoscaling *string `pulumi:"applicationautoscaling"` + // Use this to override the default service endpoint URL + Applicationinsights *string `pulumi:"applicationinsights"` + // Use this to override the default service endpoint URL + Applicationsignals *string `pulumi:"applicationsignals"` + // Use this to override the default service endpoint URL + Appmesh *string `pulumi:"appmesh"` + // Use this to override the default service endpoint URL + Appregistry *string `pulumi:"appregistry"` + // Use this to override the default service endpoint URL + Apprunner *string `pulumi:"apprunner"` + // Use this to override the default service endpoint URL + Appstream *string `pulumi:"appstream"` + // Use this to override the default service endpoint URL + Appsync *string `pulumi:"appsync"` + // Use this to override the default service endpoint URL + Athena *string `pulumi:"athena"` + // Use this to override the default service endpoint URL + Auditmanager *string `pulumi:"auditmanager"` + // Use this to override the default service endpoint URL + Autoscaling *string `pulumi:"autoscaling"` + // Use this to override the default service endpoint URL + Autoscalingplans *string `pulumi:"autoscalingplans"` + // Use this to override the default service endpoint URL + Backup *string `pulumi:"backup"` + // Use this to override the default service endpoint URL + Batch *string `pulumi:"batch"` + // Use this to override the default service endpoint URL + Bcmdataexports *string `pulumi:"bcmdataexports"` + // Use this to override the default service endpoint URL + Beanstalk *string `pulumi:"beanstalk"` + // Use this to override the default service endpoint URL + Bedrock *string `pulumi:"bedrock"` + // Use this to override the default service endpoint URL + Bedrockagent *string `pulumi:"bedrockagent"` + // Use this to override the default service endpoint URL + Billing *string `pulumi:"billing"` + // Use this to override the default service endpoint URL + Budgets *string `pulumi:"budgets"` + // Use this to override the default service endpoint URL + Ce *string `pulumi:"ce"` + // Use this to override the default service endpoint URL + Chatbot *string `pulumi:"chatbot"` + // Use this to override the default service endpoint URL + Chime *string `pulumi:"chime"` + // Use this to override the default service endpoint URL + Chimesdkmediapipelines *string `pulumi:"chimesdkmediapipelines"` + // Use this to override the default service endpoint URL + Chimesdkvoice *string `pulumi:"chimesdkvoice"` + // Use this to override the default service endpoint URL + Cleanrooms *string `pulumi:"cleanrooms"` + // Use this to override the default service endpoint URL + Cloud9 *string `pulumi:"cloud9"` + // Use this to override the default service endpoint URL + Cloudcontrol *string `pulumi:"cloudcontrol"` + // Use this to override the default service endpoint URL + Cloudcontrolapi *string `pulumi:"cloudcontrolapi"` + // Use this to override the default service endpoint URL + Cloudformation *string `pulumi:"cloudformation"` + // Use this to override the default service endpoint URL + Cloudfront *string `pulumi:"cloudfront"` + // Use this to override the default service endpoint URL + Cloudfrontkeyvaluestore *string `pulumi:"cloudfrontkeyvaluestore"` + // Use this to override the default service endpoint URL + Cloudhsm *string `pulumi:"cloudhsm"` + // Use this to override the default service endpoint URL + Cloudhsmv2 *string `pulumi:"cloudhsmv2"` + // Use this to override the default service endpoint URL + Cloudsearch *string `pulumi:"cloudsearch"` + // Use this to override the default service endpoint URL + Cloudtrail *string `pulumi:"cloudtrail"` + // Use this to override the default service endpoint URL + Cloudwatch *string `pulumi:"cloudwatch"` + // Use this to override the default service endpoint URL + Cloudwatchevents *string `pulumi:"cloudwatchevents"` + // Use this to override the default service endpoint URL + Cloudwatchevidently *string `pulumi:"cloudwatchevidently"` + // Use this to override the default service endpoint URL + Cloudwatchlog *string `pulumi:"cloudwatchlog"` + // Use this to override the default service endpoint URL + Cloudwatchlogs *string `pulumi:"cloudwatchlogs"` + // Use this to override the default service endpoint URL + Cloudwatchobservabilityaccessmanager *string `pulumi:"cloudwatchobservabilityaccessmanager"` + // Use this to override the default service endpoint URL + Cloudwatchrum *string `pulumi:"cloudwatchrum"` + // Use this to override the default service endpoint URL + Codeartifact *string `pulumi:"codeartifact"` + // Use this to override the default service endpoint URL + Codebuild *string `pulumi:"codebuild"` + // Use this to override the default service endpoint URL + Codecatalyst *string `pulumi:"codecatalyst"` + // Use this to override the default service endpoint URL + Codecommit *string `pulumi:"codecommit"` + // Use this to override the default service endpoint URL + Codeconnections *string `pulumi:"codeconnections"` + // Use this to override the default service endpoint URL + Codedeploy *string `pulumi:"codedeploy"` + // Use this to override the default service endpoint URL + Codeguruprofiler *string `pulumi:"codeguruprofiler"` + // Use this to override the default service endpoint URL + Codegurureviewer *string `pulumi:"codegurureviewer"` + // Use this to override the default service endpoint URL + Codepipeline *string `pulumi:"codepipeline"` + // Use this to override the default service endpoint URL + Codestarconnections *string `pulumi:"codestarconnections"` + // Use this to override the default service endpoint URL + Codestarnotifications *string `pulumi:"codestarnotifications"` + // Use this to override the default service endpoint URL + Cognitoidentity *string `pulumi:"cognitoidentity"` + // Use this to override the default service endpoint URL + Cognitoidentityprovider *string `pulumi:"cognitoidentityprovider"` + // Use this to override the default service endpoint URL + Cognitoidp *string `pulumi:"cognitoidp"` + // Use this to override the default service endpoint URL + Comprehend *string `pulumi:"comprehend"` + // Use this to override the default service endpoint URL + Computeoptimizer *string `pulumi:"computeoptimizer"` + // Use this to override the default service endpoint URL + Config *string `pulumi:"config"` + // Use this to override the default service endpoint URL + Configservice *string `pulumi:"configservice"` + // Use this to override the default service endpoint URL + Connect *string `pulumi:"connect"` + // Use this to override the default service endpoint URL + Connectcases *string `pulumi:"connectcases"` + // Use this to override the default service endpoint URL + Controltower *string `pulumi:"controltower"` + // Use this to override the default service endpoint URL + Costandusagereportservice *string `pulumi:"costandusagereportservice"` + // Use this to override the default service endpoint URL + Costexplorer *string `pulumi:"costexplorer"` + // Use this to override the default service endpoint URL + Costoptimizationhub *string `pulumi:"costoptimizationhub"` + // Use this to override the default service endpoint URL + Cur *string `pulumi:"cur"` + // Use this to override the default service endpoint URL + Customerprofiles *string `pulumi:"customerprofiles"` + // Use this to override the default service endpoint URL + Databasemigration *string `pulumi:"databasemigration"` + // Use this to override the default service endpoint URL + Databasemigrationservice *string `pulumi:"databasemigrationservice"` + // Use this to override the default service endpoint URL + Databrew *string `pulumi:"databrew"` + // Use this to override the default service endpoint URL + Dataexchange *string `pulumi:"dataexchange"` + // Use this to override the default service endpoint URL + Datapipeline *string `pulumi:"datapipeline"` + // Use this to override the default service endpoint URL + Datasync *string `pulumi:"datasync"` + // Use this to override the default service endpoint URL + Datazone *string `pulumi:"datazone"` + // Use this to override the default service endpoint URL + Dax *string `pulumi:"dax"` + // Use this to override the default service endpoint URL + Deploy *string `pulumi:"deploy"` + // Use this to override the default service endpoint URL + Detective *string `pulumi:"detective"` + // Use this to override the default service endpoint URL + Devicefarm *string `pulumi:"devicefarm"` + // Use this to override the default service endpoint URL + Devopsguru *string `pulumi:"devopsguru"` + // Use this to override the default service endpoint URL + Directconnect *string `pulumi:"directconnect"` + // Use this to override the default service endpoint URL + Directoryservice *string `pulumi:"directoryservice"` + // Use this to override the default service endpoint URL + Dlm *string `pulumi:"dlm"` + // Use this to override the default service endpoint URL + Dms *string `pulumi:"dms"` + // Use this to override the default service endpoint URL + Docdb *string `pulumi:"docdb"` + // Use this to override the default service endpoint URL + Docdbelastic *string `pulumi:"docdbelastic"` + // Use this to override the default service endpoint URL + Drs *string `pulumi:"drs"` + // Use this to override the default service endpoint URL + Ds *string `pulumi:"ds"` + // Use this to override the default service endpoint URL + Dsql *string `pulumi:"dsql"` + // Use this to override the default service endpoint URL + Dynamodb *string `pulumi:"dynamodb"` + // Use this to override the default service endpoint URL + Ec2 *string `pulumi:"ec2"` + // Use this to override the default service endpoint URL + Ecr *string `pulumi:"ecr"` + // Use this to override the default service endpoint URL + Ecrpublic *string `pulumi:"ecrpublic"` + // Use this to override the default service endpoint URL + Ecs *string `pulumi:"ecs"` + // Use this to override the default service endpoint URL + Efs *string `pulumi:"efs"` + // Use this to override the default service endpoint URL + Eks *string `pulumi:"eks"` + // Use this to override the default service endpoint URL + Elasticache *string `pulumi:"elasticache"` + // Use this to override the default service endpoint URL + Elasticbeanstalk *string `pulumi:"elasticbeanstalk"` + // Use this to override the default service endpoint URL + Elasticloadbalancing *string `pulumi:"elasticloadbalancing"` + // Use this to override the default service endpoint URL + Elasticloadbalancingv2 *string `pulumi:"elasticloadbalancingv2"` + // Use this to override the default service endpoint URL + Elasticsearch *string `pulumi:"elasticsearch"` + // Use this to override the default service endpoint URL + Elasticsearchservice *string `pulumi:"elasticsearchservice"` + // Use this to override the default service endpoint URL + Elastictranscoder *string `pulumi:"elastictranscoder"` + // Use this to override the default service endpoint URL + Elb *string `pulumi:"elb"` + // Use this to override the default service endpoint URL + Elbv2 *string `pulumi:"elbv2"` + // Use this to override the default service endpoint URL + Emr *string `pulumi:"emr"` + // Use this to override the default service endpoint URL + Emrcontainers *string `pulumi:"emrcontainers"` + // Use this to override the default service endpoint URL + Emrserverless *string `pulumi:"emrserverless"` + // Use this to override the default service endpoint URL + Es *string `pulumi:"es"` + // Use this to override the default service endpoint URL + Eventbridge *string `pulumi:"eventbridge"` + // Use this to override the default service endpoint URL + Events *string `pulumi:"events"` + // Use this to override the default service endpoint URL + Evidently *string `pulumi:"evidently"` + // Use this to override the default service endpoint URL + Finspace *string `pulumi:"finspace"` + // Use this to override the default service endpoint URL + Firehose *string `pulumi:"firehose"` + // Use this to override the default service endpoint URL + Fis *string `pulumi:"fis"` + // Use this to override the default service endpoint URL + Fms *string `pulumi:"fms"` + // Use this to override the default service endpoint URL + Fsx *string `pulumi:"fsx"` + // Use this to override the default service endpoint URL + Gamelift *string `pulumi:"gamelift"` + // Use this to override the default service endpoint URL + Glacier *string `pulumi:"glacier"` + // Use this to override the default service endpoint URL + Globalaccelerator *string `pulumi:"globalaccelerator"` + // Use this to override the default service endpoint URL + Glue *string `pulumi:"glue"` + // Use this to override the default service endpoint URL + Gluedatabrew *string `pulumi:"gluedatabrew"` + // Use this to override the default service endpoint URL + Grafana *string `pulumi:"grafana"` + // Use this to override the default service endpoint URL + Greengrass *string `pulumi:"greengrass"` + // Use this to override the default service endpoint URL + Groundstation *string `pulumi:"groundstation"` + // Use this to override the default service endpoint URL + Guardduty *string `pulumi:"guardduty"` + // Use this to override the default service endpoint URL + Healthlake *string `pulumi:"healthlake"` + // Use this to override the default service endpoint URL + Iam *string `pulumi:"iam"` + // Use this to override the default service endpoint URL + Identitystore *string `pulumi:"identitystore"` + // Use this to override the default service endpoint URL + Imagebuilder *string `pulumi:"imagebuilder"` + // Use this to override the default service endpoint URL + Inspector *string `pulumi:"inspector"` + // Use this to override the default service endpoint URL + Inspector2 *string `pulumi:"inspector2"` + // Use this to override the default service endpoint URL + Inspectorv2 *string `pulumi:"inspectorv2"` + // Use this to override the default service endpoint URL + Internetmonitor *string `pulumi:"internetmonitor"` + // Use this to override the default service endpoint URL + Invoicing *string `pulumi:"invoicing"` + // Use this to override the default service endpoint URL + Iot *string `pulumi:"iot"` + // Use this to override the default service endpoint URL + Iotanalytics *string `pulumi:"iotanalytics"` + // Use this to override the default service endpoint URL + Iotevents *string `pulumi:"iotevents"` + // Use this to override the default service endpoint URL + Ivs *string `pulumi:"ivs"` + // Use this to override the default service endpoint URL + Ivschat *string `pulumi:"ivschat"` + // Use this to override the default service endpoint URL + Kafka *string `pulumi:"kafka"` + // Use this to override the default service endpoint URL + Kafkaconnect *string `pulumi:"kafkaconnect"` + // Use this to override the default service endpoint URL + Kendra *string `pulumi:"kendra"` + // Use this to override the default service endpoint URL + Keyspaces *string `pulumi:"keyspaces"` + // Use this to override the default service endpoint URL + Kinesis *string `pulumi:"kinesis"` + // Use this to override the default service endpoint URL + Kinesisanalytics *string `pulumi:"kinesisanalytics"` + // Use this to override the default service endpoint URL + Kinesisanalyticsv2 *string `pulumi:"kinesisanalyticsv2"` + // Use this to override the default service endpoint URL + Kinesisvideo *string `pulumi:"kinesisvideo"` + // Use this to override the default service endpoint URL + Kms *string `pulumi:"kms"` + // Use this to override the default service endpoint URL + Lakeformation *string `pulumi:"lakeformation"` + // Use this to override the default service endpoint URL + Lambda *string `pulumi:"lambda"` + // Use this to override the default service endpoint URL + Launchwizard *string `pulumi:"launchwizard"` + // Use this to override the default service endpoint URL + Lex *string `pulumi:"lex"` + // Use this to override the default service endpoint URL + Lexmodelbuilding *string `pulumi:"lexmodelbuilding"` + // Use this to override the default service endpoint URL + Lexmodelbuildingservice *string `pulumi:"lexmodelbuildingservice"` + // Use this to override the default service endpoint URL + Lexmodels *string `pulumi:"lexmodels"` + // Use this to override the default service endpoint URL + Lexmodelsv2 *string `pulumi:"lexmodelsv2"` + // Use this to override the default service endpoint URL + Lexv2models *string `pulumi:"lexv2models"` + // Use this to override the default service endpoint URL + Licensemanager *string `pulumi:"licensemanager"` + // Use this to override the default service endpoint URL + Lightsail *string `pulumi:"lightsail"` + // Use this to override the default service endpoint URL + Location *string `pulumi:"location"` + // Use this to override the default service endpoint URL + Locationservice *string `pulumi:"locationservice"` + // Use this to override the default service endpoint URL + Logs *string `pulumi:"logs"` + // Use this to override the default service endpoint URL + Lookoutmetrics *string `pulumi:"lookoutmetrics"` + // Use this to override the default service endpoint URL + M2 *string `pulumi:"m2"` + // Use this to override the default service endpoint URL + Macie2 *string `pulumi:"macie2"` + // Use this to override the default service endpoint URL + Managedgrafana *string `pulumi:"managedgrafana"` + // Use this to override the default service endpoint URL + Mediaconnect *string `pulumi:"mediaconnect"` + // Use this to override the default service endpoint URL + Mediaconvert *string `pulumi:"mediaconvert"` + // Use this to override the default service endpoint URL + Medialive *string `pulumi:"medialive"` + // Use this to override the default service endpoint URL + Mediapackage *string `pulumi:"mediapackage"` + // Use this to override the default service endpoint URL + Mediapackagev2 *string `pulumi:"mediapackagev2"` + // Use this to override the default service endpoint URL + Mediapackagevod *string `pulumi:"mediapackagevod"` + // Use this to override the default service endpoint URL + Mediastore *string `pulumi:"mediastore"` + // Use this to override the default service endpoint URL + Memorydb *string `pulumi:"memorydb"` + // Use this to override the default service endpoint URL + Mgn *string `pulumi:"mgn"` + // Use this to override the default service endpoint URL + Mq *string `pulumi:"mq"` + // Use this to override the default service endpoint URL + Msk *string `pulumi:"msk"` + // Use this to override the default service endpoint URL + Mwaa *string `pulumi:"mwaa"` + // Use this to override the default service endpoint URL + Neptune *string `pulumi:"neptune"` + // Use this to override the default service endpoint URL + Neptunegraph *string `pulumi:"neptunegraph"` + // Use this to override the default service endpoint URL + Networkfirewall *string `pulumi:"networkfirewall"` + // Use this to override the default service endpoint URL + Networkmanager *string `pulumi:"networkmanager"` + // Use this to override the default service endpoint URL + Networkmonitor *string `pulumi:"networkmonitor"` + // Use this to override the default service endpoint URL + Oam *string `pulumi:"oam"` + // Use this to override the default service endpoint URL + Opensearch *string `pulumi:"opensearch"` + // Use this to override the default service endpoint URL + Opensearchingestion *string `pulumi:"opensearchingestion"` + // Use this to override the default service endpoint URL + Opensearchserverless *string `pulumi:"opensearchserverless"` + // Use this to override the default service endpoint URL + Opensearchservice *string `pulumi:"opensearchservice"` + // Use this to override the default service endpoint URL + Opsworks *string `pulumi:"opsworks"` + // Use this to override the default service endpoint URL + Organizations *string `pulumi:"organizations"` + // Use this to override the default service endpoint URL + Osis *string `pulumi:"osis"` + // Use this to override the default service endpoint URL + Outposts *string `pulumi:"outposts"` + // Use this to override the default service endpoint URL + Paymentcryptography *string `pulumi:"paymentcryptography"` + // Use this to override the default service endpoint URL + Pcaconnectorad *string `pulumi:"pcaconnectorad"` + // Use this to override the default service endpoint URL + Pcs *string `pulumi:"pcs"` + // Use this to override the default service endpoint URL + Pinpoint *string `pulumi:"pinpoint"` + // Use this to override the default service endpoint URL + Pinpointsmsvoicev2 *string `pulumi:"pinpointsmsvoicev2"` + // Use this to override the default service endpoint URL + Pipes *string `pulumi:"pipes"` + // Use this to override the default service endpoint URL + Polly *string `pulumi:"polly"` + // Use this to override the default service endpoint URL + Pricing *string `pulumi:"pricing"` + // Use this to override the default service endpoint URL + Prometheus *string `pulumi:"prometheus"` + // Use this to override the default service endpoint URL + Prometheusservice *string `pulumi:"prometheusservice"` + // Use this to override the default service endpoint URL + Qbusiness *string `pulumi:"qbusiness"` + // Use this to override the default service endpoint URL + Qldb *string `pulumi:"qldb"` + // Use this to override the default service endpoint URL + Quicksight *string `pulumi:"quicksight"` + // Use this to override the default service endpoint URL + Ram *string `pulumi:"ram"` + // Use this to override the default service endpoint URL + Rbin *string `pulumi:"rbin"` + // Use this to override the default service endpoint URL + Rds *string `pulumi:"rds"` + // Use this to override the default service endpoint URL + Recyclebin *string `pulumi:"recyclebin"` + // Use this to override the default service endpoint URL + Redshift *string `pulumi:"redshift"` + // Use this to override the default service endpoint URL + Redshiftdata *string `pulumi:"redshiftdata"` + // Use this to override the default service endpoint URL + Redshiftdataapiservice *string `pulumi:"redshiftdataapiservice"` + // Use this to override the default service endpoint URL + Redshiftserverless *string `pulumi:"redshiftserverless"` + // Use this to override the default service endpoint URL + Rekognition *string `pulumi:"rekognition"` + // Use this to override the default service endpoint URL + Resiliencehub *string `pulumi:"resiliencehub"` + // Use this to override the default service endpoint URL + Resourceexplorer2 *string `pulumi:"resourceexplorer2"` + // Use this to override the default service endpoint URL + Resourcegroups *string `pulumi:"resourcegroups"` + // Use this to override the default service endpoint URL + Resourcegroupstagging *string `pulumi:"resourcegroupstagging"` + // Use this to override the default service endpoint URL + Resourcegroupstaggingapi *string `pulumi:"resourcegroupstaggingapi"` + // Use this to override the default service endpoint URL + Rolesanywhere *string `pulumi:"rolesanywhere"` + // Use this to override the default service endpoint URL + Route53 *string `pulumi:"route53"` + // Use this to override the default service endpoint URL + Route53domains *string `pulumi:"route53domains"` + // Use this to override the default service endpoint URL + Route53profiles *string `pulumi:"route53profiles"` + // Use this to override the default service endpoint URL + Route53recoverycontrolconfig *string `pulumi:"route53recoverycontrolconfig"` + // Use this to override the default service endpoint URL + Route53recoveryreadiness *string `pulumi:"route53recoveryreadiness"` + // Use this to override the default service endpoint URL + Route53resolver *string `pulumi:"route53resolver"` + // Use this to override the default service endpoint URL + Rum *string `pulumi:"rum"` + // Use this to override the default service endpoint URL + S3 *string `pulumi:"s3"` + // Use this to override the default service endpoint URL + S3api *string `pulumi:"s3api"` + // Use this to override the default service endpoint URL + S3control *string `pulumi:"s3control"` + // Use this to override the default service endpoint URL + S3outposts *string `pulumi:"s3outposts"` + // Use this to override the default service endpoint URL + S3tables *string `pulumi:"s3tables"` + // Use this to override the default service endpoint URL + Sagemaker *string `pulumi:"sagemaker"` + // Use this to override the default service endpoint URL + Scheduler *string `pulumi:"scheduler"` + // Use this to override the default service endpoint URL + Schemas *string `pulumi:"schemas"` + // Use this to override the default service endpoint URL + Sdb *string `pulumi:"sdb"` + // Use this to override the default service endpoint URL + Secretsmanager *string `pulumi:"secretsmanager"` + // Use this to override the default service endpoint URL + Securityhub *string `pulumi:"securityhub"` + // Use this to override the default service endpoint URL + Securitylake *string `pulumi:"securitylake"` + // Use this to override the default service endpoint URL + Serverlessapplicationrepository *string `pulumi:"serverlessapplicationrepository"` + // Use this to override the default service endpoint URL + Serverlessapprepo *string `pulumi:"serverlessapprepo"` + // Use this to override the default service endpoint URL + Serverlessrepo *string `pulumi:"serverlessrepo"` + // Use this to override the default service endpoint URL + Servicecatalog *string `pulumi:"servicecatalog"` + // Use this to override the default service endpoint URL + Servicecatalogappregistry *string `pulumi:"servicecatalogappregistry"` + // Use this to override the default service endpoint URL + Servicediscovery *string `pulumi:"servicediscovery"` + // Use this to override the default service endpoint URL + Servicequotas *string `pulumi:"servicequotas"` + // Use this to override the default service endpoint URL + Ses *string `pulumi:"ses"` + // Use this to override the default service endpoint URL + Sesv2 *string `pulumi:"sesv2"` + // Use this to override the default service endpoint URL + Sfn *string `pulumi:"sfn"` + // Use this to override the default service endpoint URL + Shield *string `pulumi:"shield"` + // Use this to override the default service endpoint URL + Signer *string `pulumi:"signer"` + // Use this to override the default service endpoint URL + Simpledb *string `pulumi:"simpledb"` + // Use this to override the default service endpoint URL + Sns *string `pulumi:"sns"` + // Use this to override the default service endpoint URL + Sqs *string `pulumi:"sqs"` + // Use this to override the default service endpoint URL + Ssm *string `pulumi:"ssm"` + // Use this to override the default service endpoint URL + Ssmcontacts *string `pulumi:"ssmcontacts"` + // Use this to override the default service endpoint URL + Ssmincidents *string `pulumi:"ssmincidents"` + // Use this to override the default service endpoint URL + Ssmquicksetup *string `pulumi:"ssmquicksetup"` + // Use this to override the default service endpoint URL + Ssmsap *string `pulumi:"ssmsap"` + // Use this to override the default service endpoint URL + Sso *string `pulumi:"sso"` + // Use this to override the default service endpoint URL + Ssoadmin *string `pulumi:"ssoadmin"` + // Use this to override the default service endpoint URL + Stepfunctions *string `pulumi:"stepfunctions"` + // Use this to override the default service endpoint URL + Storagegateway *string `pulumi:"storagegateway"` + // Use this to override the default service endpoint URL + Sts *string `pulumi:"sts"` + // Use this to override the default service endpoint URL + Swf *string `pulumi:"swf"` + // Use this to override the default service endpoint URL + Synthetics *string `pulumi:"synthetics"` + // Use this to override the default service endpoint URL + Taxsettings *string `pulumi:"taxsettings"` + // Use this to override the default service endpoint URL + Timestreaminfluxdb *string `pulumi:"timestreaminfluxdb"` + // Use this to override the default service endpoint URL + Timestreamquery *string `pulumi:"timestreamquery"` + // Use this to override the default service endpoint URL + Timestreamwrite *string `pulumi:"timestreamwrite"` + // Use this to override the default service endpoint URL + Transcribe *string `pulumi:"transcribe"` + // Use this to override the default service endpoint URL + Transcribeservice *string `pulumi:"transcribeservice"` + // Use this to override the default service endpoint URL + Transfer *string `pulumi:"transfer"` + // Use this to override the default service endpoint URL + Verifiedpermissions *string `pulumi:"verifiedpermissions"` + // Use this to override the default service endpoint URL + Vpclattice *string `pulumi:"vpclattice"` + // Use this to override the default service endpoint URL + Waf *string `pulumi:"waf"` + // Use this to override the default service endpoint URL + Wafregional *string `pulumi:"wafregional"` + // Use this to override the default service endpoint URL + Wafv2 *string `pulumi:"wafv2"` + // Use this to override the default service endpoint URL + Wellarchitected *string `pulumi:"wellarchitected"` + // Use this to override the default service endpoint URL + Worklink *string `pulumi:"worklink"` + // Use this to override the default service endpoint URL + Workspaces *string `pulumi:"workspaces"` + // Use this to override the default service endpoint URL + Workspacesweb *string `pulumi:"workspacesweb"` + // Use this to override the default service endpoint URL + Xray *string `pulumi:"xray"` +} + +// ProviderEndpointInput is an input type that accepts ProviderEndpointArgs and ProviderEndpointOutput values. +// You can construct a concrete instance of `ProviderEndpointInput` via: +// +// ProviderEndpointArgs{...} +type ProviderEndpointInput interface { + pulumi.Input + + ToProviderEndpointOutput() ProviderEndpointOutput + ToProviderEndpointOutputWithContext(context.Context) ProviderEndpointOutput +} + +type ProviderEndpointArgs struct { + // Use this to override the default service endpoint URL + Accessanalyzer pulumi.StringPtrInput `pulumi:"accessanalyzer"` + // Use this to override the default service endpoint URL + Account pulumi.StringPtrInput `pulumi:"account"` + // Use this to override the default service endpoint URL + Acm pulumi.StringPtrInput `pulumi:"acm"` + // Use this to override the default service endpoint URL + Acmpca pulumi.StringPtrInput `pulumi:"acmpca"` + // Use this to override the default service endpoint URL + Amg pulumi.StringPtrInput `pulumi:"amg"` + // Use this to override the default service endpoint URL + Amp pulumi.StringPtrInput `pulumi:"amp"` + // Use this to override the default service endpoint URL + Amplify pulumi.StringPtrInput `pulumi:"amplify"` + // Use this to override the default service endpoint URL + Apigateway pulumi.StringPtrInput `pulumi:"apigateway"` + // Use this to override the default service endpoint URL + Apigatewayv2 pulumi.StringPtrInput `pulumi:"apigatewayv2"` + // Use this to override the default service endpoint URL + Appautoscaling pulumi.StringPtrInput `pulumi:"appautoscaling"` + // Use this to override the default service endpoint URL + Appconfig pulumi.StringPtrInput `pulumi:"appconfig"` + // Use this to override the default service endpoint URL + Appfabric pulumi.StringPtrInput `pulumi:"appfabric"` + // Use this to override the default service endpoint URL + Appflow pulumi.StringPtrInput `pulumi:"appflow"` + // Use this to override the default service endpoint URL + Appintegrations pulumi.StringPtrInput `pulumi:"appintegrations"` + // Use this to override the default service endpoint URL + Appintegrationsservice pulumi.StringPtrInput `pulumi:"appintegrationsservice"` + // Use this to override the default service endpoint URL + Applicationautoscaling pulumi.StringPtrInput `pulumi:"applicationautoscaling"` + // Use this to override the default service endpoint URL + Applicationinsights pulumi.StringPtrInput `pulumi:"applicationinsights"` + // Use this to override the default service endpoint URL + Applicationsignals pulumi.StringPtrInput `pulumi:"applicationsignals"` + // Use this to override the default service endpoint URL + Appmesh pulumi.StringPtrInput `pulumi:"appmesh"` + // Use this to override the default service endpoint URL + Appregistry pulumi.StringPtrInput `pulumi:"appregistry"` + // Use this to override the default service endpoint URL + Apprunner pulumi.StringPtrInput `pulumi:"apprunner"` + // Use this to override the default service endpoint URL + Appstream pulumi.StringPtrInput `pulumi:"appstream"` + // Use this to override the default service endpoint URL + Appsync pulumi.StringPtrInput `pulumi:"appsync"` + // Use this to override the default service endpoint URL + Athena pulumi.StringPtrInput `pulumi:"athena"` + // Use this to override the default service endpoint URL + Auditmanager pulumi.StringPtrInput `pulumi:"auditmanager"` + // Use this to override the default service endpoint URL + Autoscaling pulumi.StringPtrInput `pulumi:"autoscaling"` + // Use this to override the default service endpoint URL + Autoscalingplans pulumi.StringPtrInput `pulumi:"autoscalingplans"` + // Use this to override the default service endpoint URL + Backup pulumi.StringPtrInput `pulumi:"backup"` + // Use this to override the default service endpoint URL + Batch pulumi.StringPtrInput `pulumi:"batch"` + // Use this to override the default service endpoint URL + Bcmdataexports pulumi.StringPtrInput `pulumi:"bcmdataexports"` + // Use this to override the default service endpoint URL + Beanstalk pulumi.StringPtrInput `pulumi:"beanstalk"` + // Use this to override the default service endpoint URL + Bedrock pulumi.StringPtrInput `pulumi:"bedrock"` + // Use this to override the default service endpoint URL + Bedrockagent pulumi.StringPtrInput `pulumi:"bedrockagent"` + // Use this to override the default service endpoint URL + Billing pulumi.StringPtrInput `pulumi:"billing"` + // Use this to override the default service endpoint URL + Budgets pulumi.StringPtrInput `pulumi:"budgets"` + // Use this to override the default service endpoint URL + Ce pulumi.StringPtrInput `pulumi:"ce"` + // Use this to override the default service endpoint URL + Chatbot pulumi.StringPtrInput `pulumi:"chatbot"` + // Use this to override the default service endpoint URL + Chime pulumi.StringPtrInput `pulumi:"chime"` + // Use this to override the default service endpoint URL + Chimesdkmediapipelines pulumi.StringPtrInput `pulumi:"chimesdkmediapipelines"` + // Use this to override the default service endpoint URL + Chimesdkvoice pulumi.StringPtrInput `pulumi:"chimesdkvoice"` + // Use this to override the default service endpoint URL + Cleanrooms pulumi.StringPtrInput `pulumi:"cleanrooms"` + // Use this to override the default service endpoint URL + Cloud9 pulumi.StringPtrInput `pulumi:"cloud9"` + // Use this to override the default service endpoint URL + Cloudcontrol pulumi.StringPtrInput `pulumi:"cloudcontrol"` + // Use this to override the default service endpoint URL + Cloudcontrolapi pulumi.StringPtrInput `pulumi:"cloudcontrolapi"` + // Use this to override the default service endpoint URL + Cloudformation pulumi.StringPtrInput `pulumi:"cloudformation"` + // Use this to override the default service endpoint URL + Cloudfront pulumi.StringPtrInput `pulumi:"cloudfront"` + // Use this to override the default service endpoint URL + Cloudfrontkeyvaluestore pulumi.StringPtrInput `pulumi:"cloudfrontkeyvaluestore"` + // Use this to override the default service endpoint URL + Cloudhsm pulumi.StringPtrInput `pulumi:"cloudhsm"` + // Use this to override the default service endpoint URL + Cloudhsmv2 pulumi.StringPtrInput `pulumi:"cloudhsmv2"` + // Use this to override the default service endpoint URL + Cloudsearch pulumi.StringPtrInput `pulumi:"cloudsearch"` + // Use this to override the default service endpoint URL + Cloudtrail pulumi.StringPtrInput `pulumi:"cloudtrail"` + // Use this to override the default service endpoint URL + Cloudwatch pulumi.StringPtrInput `pulumi:"cloudwatch"` + // Use this to override the default service endpoint URL + Cloudwatchevents pulumi.StringPtrInput `pulumi:"cloudwatchevents"` + // Use this to override the default service endpoint URL + Cloudwatchevidently pulumi.StringPtrInput `pulumi:"cloudwatchevidently"` + // Use this to override the default service endpoint URL + Cloudwatchlog pulumi.StringPtrInput `pulumi:"cloudwatchlog"` + // Use this to override the default service endpoint URL + Cloudwatchlogs pulumi.StringPtrInput `pulumi:"cloudwatchlogs"` + // Use this to override the default service endpoint URL + Cloudwatchobservabilityaccessmanager pulumi.StringPtrInput `pulumi:"cloudwatchobservabilityaccessmanager"` + // Use this to override the default service endpoint URL + Cloudwatchrum pulumi.StringPtrInput `pulumi:"cloudwatchrum"` + // Use this to override the default service endpoint URL + Codeartifact pulumi.StringPtrInput `pulumi:"codeartifact"` + // Use this to override the default service endpoint URL + Codebuild pulumi.StringPtrInput `pulumi:"codebuild"` + // Use this to override the default service endpoint URL + Codecatalyst pulumi.StringPtrInput `pulumi:"codecatalyst"` + // Use this to override the default service endpoint URL + Codecommit pulumi.StringPtrInput `pulumi:"codecommit"` + // Use this to override the default service endpoint URL + Codeconnections pulumi.StringPtrInput `pulumi:"codeconnections"` + // Use this to override the default service endpoint URL + Codedeploy pulumi.StringPtrInput `pulumi:"codedeploy"` + // Use this to override the default service endpoint URL + Codeguruprofiler pulumi.StringPtrInput `pulumi:"codeguruprofiler"` + // Use this to override the default service endpoint URL + Codegurureviewer pulumi.StringPtrInput `pulumi:"codegurureviewer"` + // Use this to override the default service endpoint URL + Codepipeline pulumi.StringPtrInput `pulumi:"codepipeline"` + // Use this to override the default service endpoint URL + Codestarconnections pulumi.StringPtrInput `pulumi:"codestarconnections"` + // Use this to override the default service endpoint URL + Codestarnotifications pulumi.StringPtrInput `pulumi:"codestarnotifications"` + // Use this to override the default service endpoint URL + Cognitoidentity pulumi.StringPtrInput `pulumi:"cognitoidentity"` + // Use this to override the default service endpoint URL + Cognitoidentityprovider pulumi.StringPtrInput `pulumi:"cognitoidentityprovider"` + // Use this to override the default service endpoint URL + Cognitoidp pulumi.StringPtrInput `pulumi:"cognitoidp"` + // Use this to override the default service endpoint URL + Comprehend pulumi.StringPtrInput `pulumi:"comprehend"` + // Use this to override the default service endpoint URL + Computeoptimizer pulumi.StringPtrInput `pulumi:"computeoptimizer"` + // Use this to override the default service endpoint URL + Config pulumi.StringPtrInput `pulumi:"config"` + // Use this to override the default service endpoint URL + Configservice pulumi.StringPtrInput `pulumi:"configservice"` + // Use this to override the default service endpoint URL + Connect pulumi.StringPtrInput `pulumi:"connect"` + // Use this to override the default service endpoint URL + Connectcases pulumi.StringPtrInput `pulumi:"connectcases"` + // Use this to override the default service endpoint URL + Controltower pulumi.StringPtrInput `pulumi:"controltower"` + // Use this to override the default service endpoint URL + Costandusagereportservice pulumi.StringPtrInput `pulumi:"costandusagereportservice"` + // Use this to override the default service endpoint URL + Costexplorer pulumi.StringPtrInput `pulumi:"costexplorer"` + // Use this to override the default service endpoint URL + Costoptimizationhub pulumi.StringPtrInput `pulumi:"costoptimizationhub"` + // Use this to override the default service endpoint URL + Cur pulumi.StringPtrInput `pulumi:"cur"` + // Use this to override the default service endpoint URL + Customerprofiles pulumi.StringPtrInput `pulumi:"customerprofiles"` + // Use this to override the default service endpoint URL + Databasemigration pulumi.StringPtrInput `pulumi:"databasemigration"` + // Use this to override the default service endpoint URL + Databasemigrationservice pulumi.StringPtrInput `pulumi:"databasemigrationservice"` + // Use this to override the default service endpoint URL + Databrew pulumi.StringPtrInput `pulumi:"databrew"` + // Use this to override the default service endpoint URL + Dataexchange pulumi.StringPtrInput `pulumi:"dataexchange"` + // Use this to override the default service endpoint URL + Datapipeline pulumi.StringPtrInput `pulumi:"datapipeline"` + // Use this to override the default service endpoint URL + Datasync pulumi.StringPtrInput `pulumi:"datasync"` + // Use this to override the default service endpoint URL + Datazone pulumi.StringPtrInput `pulumi:"datazone"` + // Use this to override the default service endpoint URL + Dax pulumi.StringPtrInput `pulumi:"dax"` + // Use this to override the default service endpoint URL + Deploy pulumi.StringPtrInput `pulumi:"deploy"` + // Use this to override the default service endpoint URL + Detective pulumi.StringPtrInput `pulumi:"detective"` + // Use this to override the default service endpoint URL + Devicefarm pulumi.StringPtrInput `pulumi:"devicefarm"` + // Use this to override the default service endpoint URL + Devopsguru pulumi.StringPtrInput `pulumi:"devopsguru"` + // Use this to override the default service endpoint URL + Directconnect pulumi.StringPtrInput `pulumi:"directconnect"` + // Use this to override the default service endpoint URL + Directoryservice pulumi.StringPtrInput `pulumi:"directoryservice"` + // Use this to override the default service endpoint URL + Dlm pulumi.StringPtrInput `pulumi:"dlm"` + // Use this to override the default service endpoint URL + Dms pulumi.StringPtrInput `pulumi:"dms"` + // Use this to override the default service endpoint URL + Docdb pulumi.StringPtrInput `pulumi:"docdb"` + // Use this to override the default service endpoint URL + Docdbelastic pulumi.StringPtrInput `pulumi:"docdbelastic"` + // Use this to override the default service endpoint URL + Drs pulumi.StringPtrInput `pulumi:"drs"` + // Use this to override the default service endpoint URL + Ds pulumi.StringPtrInput `pulumi:"ds"` + // Use this to override the default service endpoint URL + Dsql pulumi.StringPtrInput `pulumi:"dsql"` + // Use this to override the default service endpoint URL + Dynamodb pulumi.StringPtrInput `pulumi:"dynamodb"` + // Use this to override the default service endpoint URL + Ec2 pulumi.StringPtrInput `pulumi:"ec2"` + // Use this to override the default service endpoint URL + Ecr pulumi.StringPtrInput `pulumi:"ecr"` + // Use this to override the default service endpoint URL + Ecrpublic pulumi.StringPtrInput `pulumi:"ecrpublic"` + // Use this to override the default service endpoint URL + Ecs pulumi.StringPtrInput `pulumi:"ecs"` + // Use this to override the default service endpoint URL + Efs pulumi.StringPtrInput `pulumi:"efs"` + // Use this to override the default service endpoint URL + Eks pulumi.StringPtrInput `pulumi:"eks"` + // Use this to override the default service endpoint URL + Elasticache pulumi.StringPtrInput `pulumi:"elasticache"` + // Use this to override the default service endpoint URL + Elasticbeanstalk pulumi.StringPtrInput `pulumi:"elasticbeanstalk"` + // Use this to override the default service endpoint URL + Elasticloadbalancing pulumi.StringPtrInput `pulumi:"elasticloadbalancing"` + // Use this to override the default service endpoint URL + Elasticloadbalancingv2 pulumi.StringPtrInput `pulumi:"elasticloadbalancingv2"` + // Use this to override the default service endpoint URL + Elasticsearch pulumi.StringPtrInput `pulumi:"elasticsearch"` + // Use this to override the default service endpoint URL + Elasticsearchservice pulumi.StringPtrInput `pulumi:"elasticsearchservice"` + // Use this to override the default service endpoint URL + Elastictranscoder pulumi.StringPtrInput `pulumi:"elastictranscoder"` + // Use this to override the default service endpoint URL + Elb pulumi.StringPtrInput `pulumi:"elb"` + // Use this to override the default service endpoint URL + Elbv2 pulumi.StringPtrInput `pulumi:"elbv2"` + // Use this to override the default service endpoint URL + Emr pulumi.StringPtrInput `pulumi:"emr"` + // Use this to override the default service endpoint URL + Emrcontainers pulumi.StringPtrInput `pulumi:"emrcontainers"` + // Use this to override the default service endpoint URL + Emrserverless pulumi.StringPtrInput `pulumi:"emrserverless"` + // Use this to override the default service endpoint URL + Es pulumi.StringPtrInput `pulumi:"es"` + // Use this to override the default service endpoint URL + Eventbridge pulumi.StringPtrInput `pulumi:"eventbridge"` + // Use this to override the default service endpoint URL + Events pulumi.StringPtrInput `pulumi:"events"` + // Use this to override the default service endpoint URL + Evidently pulumi.StringPtrInput `pulumi:"evidently"` + // Use this to override the default service endpoint URL + Finspace pulumi.StringPtrInput `pulumi:"finspace"` + // Use this to override the default service endpoint URL + Firehose pulumi.StringPtrInput `pulumi:"firehose"` + // Use this to override the default service endpoint URL + Fis pulumi.StringPtrInput `pulumi:"fis"` + // Use this to override the default service endpoint URL + Fms pulumi.StringPtrInput `pulumi:"fms"` + // Use this to override the default service endpoint URL + Fsx pulumi.StringPtrInput `pulumi:"fsx"` + // Use this to override the default service endpoint URL + Gamelift pulumi.StringPtrInput `pulumi:"gamelift"` + // Use this to override the default service endpoint URL + Glacier pulumi.StringPtrInput `pulumi:"glacier"` + // Use this to override the default service endpoint URL + Globalaccelerator pulumi.StringPtrInput `pulumi:"globalaccelerator"` + // Use this to override the default service endpoint URL + Glue pulumi.StringPtrInput `pulumi:"glue"` + // Use this to override the default service endpoint URL + Gluedatabrew pulumi.StringPtrInput `pulumi:"gluedatabrew"` + // Use this to override the default service endpoint URL + Grafana pulumi.StringPtrInput `pulumi:"grafana"` + // Use this to override the default service endpoint URL + Greengrass pulumi.StringPtrInput `pulumi:"greengrass"` + // Use this to override the default service endpoint URL + Groundstation pulumi.StringPtrInput `pulumi:"groundstation"` + // Use this to override the default service endpoint URL + Guardduty pulumi.StringPtrInput `pulumi:"guardduty"` + // Use this to override the default service endpoint URL + Healthlake pulumi.StringPtrInput `pulumi:"healthlake"` + // Use this to override the default service endpoint URL + Iam pulumi.StringPtrInput `pulumi:"iam"` + // Use this to override the default service endpoint URL + Identitystore pulumi.StringPtrInput `pulumi:"identitystore"` + // Use this to override the default service endpoint URL + Imagebuilder pulumi.StringPtrInput `pulumi:"imagebuilder"` + // Use this to override the default service endpoint URL + Inspector pulumi.StringPtrInput `pulumi:"inspector"` + // Use this to override the default service endpoint URL + Inspector2 pulumi.StringPtrInput `pulumi:"inspector2"` + // Use this to override the default service endpoint URL + Inspectorv2 pulumi.StringPtrInput `pulumi:"inspectorv2"` + // Use this to override the default service endpoint URL + Internetmonitor pulumi.StringPtrInput `pulumi:"internetmonitor"` + // Use this to override the default service endpoint URL + Invoicing pulumi.StringPtrInput `pulumi:"invoicing"` + // Use this to override the default service endpoint URL + Iot pulumi.StringPtrInput `pulumi:"iot"` + // Use this to override the default service endpoint URL + Iotanalytics pulumi.StringPtrInput `pulumi:"iotanalytics"` + // Use this to override the default service endpoint URL + Iotevents pulumi.StringPtrInput `pulumi:"iotevents"` + // Use this to override the default service endpoint URL + Ivs pulumi.StringPtrInput `pulumi:"ivs"` + // Use this to override the default service endpoint URL + Ivschat pulumi.StringPtrInput `pulumi:"ivschat"` + // Use this to override the default service endpoint URL + Kafka pulumi.StringPtrInput `pulumi:"kafka"` + // Use this to override the default service endpoint URL + Kafkaconnect pulumi.StringPtrInput `pulumi:"kafkaconnect"` + // Use this to override the default service endpoint URL + Kendra pulumi.StringPtrInput `pulumi:"kendra"` + // Use this to override the default service endpoint URL + Keyspaces pulumi.StringPtrInput `pulumi:"keyspaces"` + // Use this to override the default service endpoint URL + Kinesis pulumi.StringPtrInput `pulumi:"kinesis"` + // Use this to override the default service endpoint URL + Kinesisanalytics pulumi.StringPtrInput `pulumi:"kinesisanalytics"` + // Use this to override the default service endpoint URL + Kinesisanalyticsv2 pulumi.StringPtrInput `pulumi:"kinesisanalyticsv2"` + // Use this to override the default service endpoint URL + Kinesisvideo pulumi.StringPtrInput `pulumi:"kinesisvideo"` + // Use this to override the default service endpoint URL + Kms pulumi.StringPtrInput `pulumi:"kms"` + // Use this to override the default service endpoint URL + Lakeformation pulumi.StringPtrInput `pulumi:"lakeformation"` + // Use this to override the default service endpoint URL + Lambda pulumi.StringPtrInput `pulumi:"lambda"` + // Use this to override the default service endpoint URL + Launchwizard pulumi.StringPtrInput `pulumi:"launchwizard"` + // Use this to override the default service endpoint URL + Lex pulumi.StringPtrInput `pulumi:"lex"` + // Use this to override the default service endpoint URL + Lexmodelbuilding pulumi.StringPtrInput `pulumi:"lexmodelbuilding"` + // Use this to override the default service endpoint URL + Lexmodelbuildingservice pulumi.StringPtrInput `pulumi:"lexmodelbuildingservice"` + // Use this to override the default service endpoint URL + Lexmodels pulumi.StringPtrInput `pulumi:"lexmodels"` + // Use this to override the default service endpoint URL + Lexmodelsv2 pulumi.StringPtrInput `pulumi:"lexmodelsv2"` + // Use this to override the default service endpoint URL + Lexv2models pulumi.StringPtrInput `pulumi:"lexv2models"` + // Use this to override the default service endpoint URL + Licensemanager pulumi.StringPtrInput `pulumi:"licensemanager"` + // Use this to override the default service endpoint URL + Lightsail pulumi.StringPtrInput `pulumi:"lightsail"` + // Use this to override the default service endpoint URL + Location pulumi.StringPtrInput `pulumi:"location"` + // Use this to override the default service endpoint URL + Locationservice pulumi.StringPtrInput `pulumi:"locationservice"` + // Use this to override the default service endpoint URL + Logs pulumi.StringPtrInput `pulumi:"logs"` + // Use this to override the default service endpoint URL + Lookoutmetrics pulumi.StringPtrInput `pulumi:"lookoutmetrics"` + // Use this to override the default service endpoint URL + M2 pulumi.StringPtrInput `pulumi:"m2"` + // Use this to override the default service endpoint URL + Macie2 pulumi.StringPtrInput `pulumi:"macie2"` + // Use this to override the default service endpoint URL + Managedgrafana pulumi.StringPtrInput `pulumi:"managedgrafana"` + // Use this to override the default service endpoint URL + Mediaconnect pulumi.StringPtrInput `pulumi:"mediaconnect"` + // Use this to override the default service endpoint URL + Mediaconvert pulumi.StringPtrInput `pulumi:"mediaconvert"` + // Use this to override the default service endpoint URL + Medialive pulumi.StringPtrInput `pulumi:"medialive"` + // Use this to override the default service endpoint URL + Mediapackage pulumi.StringPtrInput `pulumi:"mediapackage"` + // Use this to override the default service endpoint URL + Mediapackagev2 pulumi.StringPtrInput `pulumi:"mediapackagev2"` + // Use this to override the default service endpoint URL + Mediapackagevod pulumi.StringPtrInput `pulumi:"mediapackagevod"` + // Use this to override the default service endpoint URL + Mediastore pulumi.StringPtrInput `pulumi:"mediastore"` + // Use this to override the default service endpoint URL + Memorydb pulumi.StringPtrInput `pulumi:"memorydb"` + // Use this to override the default service endpoint URL + Mgn pulumi.StringPtrInput `pulumi:"mgn"` + // Use this to override the default service endpoint URL + Mq pulumi.StringPtrInput `pulumi:"mq"` + // Use this to override the default service endpoint URL + Msk pulumi.StringPtrInput `pulumi:"msk"` + // Use this to override the default service endpoint URL + Mwaa pulumi.StringPtrInput `pulumi:"mwaa"` + // Use this to override the default service endpoint URL + Neptune pulumi.StringPtrInput `pulumi:"neptune"` + // Use this to override the default service endpoint URL + Neptunegraph pulumi.StringPtrInput `pulumi:"neptunegraph"` + // Use this to override the default service endpoint URL + Networkfirewall pulumi.StringPtrInput `pulumi:"networkfirewall"` + // Use this to override the default service endpoint URL + Networkmanager pulumi.StringPtrInput `pulumi:"networkmanager"` + // Use this to override the default service endpoint URL + Networkmonitor pulumi.StringPtrInput `pulumi:"networkmonitor"` + // Use this to override the default service endpoint URL + Oam pulumi.StringPtrInput `pulumi:"oam"` + // Use this to override the default service endpoint URL + Opensearch pulumi.StringPtrInput `pulumi:"opensearch"` + // Use this to override the default service endpoint URL + Opensearchingestion pulumi.StringPtrInput `pulumi:"opensearchingestion"` + // Use this to override the default service endpoint URL + Opensearchserverless pulumi.StringPtrInput `pulumi:"opensearchserverless"` + // Use this to override the default service endpoint URL + Opensearchservice pulumi.StringPtrInput `pulumi:"opensearchservice"` + // Use this to override the default service endpoint URL + Opsworks pulumi.StringPtrInput `pulumi:"opsworks"` + // Use this to override the default service endpoint URL + Organizations pulumi.StringPtrInput `pulumi:"organizations"` + // Use this to override the default service endpoint URL + Osis pulumi.StringPtrInput `pulumi:"osis"` + // Use this to override the default service endpoint URL + Outposts pulumi.StringPtrInput `pulumi:"outposts"` + // Use this to override the default service endpoint URL + Paymentcryptography pulumi.StringPtrInput `pulumi:"paymentcryptography"` + // Use this to override the default service endpoint URL + Pcaconnectorad pulumi.StringPtrInput `pulumi:"pcaconnectorad"` + // Use this to override the default service endpoint URL + Pcs pulumi.StringPtrInput `pulumi:"pcs"` + // Use this to override the default service endpoint URL + Pinpoint pulumi.StringPtrInput `pulumi:"pinpoint"` + // Use this to override the default service endpoint URL + Pinpointsmsvoicev2 pulumi.StringPtrInput `pulumi:"pinpointsmsvoicev2"` + // Use this to override the default service endpoint URL + Pipes pulumi.StringPtrInput `pulumi:"pipes"` + // Use this to override the default service endpoint URL + Polly pulumi.StringPtrInput `pulumi:"polly"` + // Use this to override the default service endpoint URL + Pricing pulumi.StringPtrInput `pulumi:"pricing"` + // Use this to override the default service endpoint URL + Prometheus pulumi.StringPtrInput `pulumi:"prometheus"` + // Use this to override the default service endpoint URL + Prometheusservice pulumi.StringPtrInput `pulumi:"prometheusservice"` + // Use this to override the default service endpoint URL + Qbusiness pulumi.StringPtrInput `pulumi:"qbusiness"` + // Use this to override the default service endpoint URL + Qldb pulumi.StringPtrInput `pulumi:"qldb"` + // Use this to override the default service endpoint URL + Quicksight pulumi.StringPtrInput `pulumi:"quicksight"` + // Use this to override the default service endpoint URL + Ram pulumi.StringPtrInput `pulumi:"ram"` + // Use this to override the default service endpoint URL + Rbin pulumi.StringPtrInput `pulumi:"rbin"` + // Use this to override the default service endpoint URL + Rds pulumi.StringPtrInput `pulumi:"rds"` + // Use this to override the default service endpoint URL + Recyclebin pulumi.StringPtrInput `pulumi:"recyclebin"` + // Use this to override the default service endpoint URL + Redshift pulumi.StringPtrInput `pulumi:"redshift"` + // Use this to override the default service endpoint URL + Redshiftdata pulumi.StringPtrInput `pulumi:"redshiftdata"` + // Use this to override the default service endpoint URL + Redshiftdataapiservice pulumi.StringPtrInput `pulumi:"redshiftdataapiservice"` + // Use this to override the default service endpoint URL + Redshiftserverless pulumi.StringPtrInput `pulumi:"redshiftserverless"` + // Use this to override the default service endpoint URL + Rekognition pulumi.StringPtrInput `pulumi:"rekognition"` + // Use this to override the default service endpoint URL + Resiliencehub pulumi.StringPtrInput `pulumi:"resiliencehub"` + // Use this to override the default service endpoint URL + Resourceexplorer2 pulumi.StringPtrInput `pulumi:"resourceexplorer2"` + // Use this to override the default service endpoint URL + Resourcegroups pulumi.StringPtrInput `pulumi:"resourcegroups"` + // Use this to override the default service endpoint URL + Resourcegroupstagging pulumi.StringPtrInput `pulumi:"resourcegroupstagging"` + // Use this to override the default service endpoint URL + Resourcegroupstaggingapi pulumi.StringPtrInput `pulumi:"resourcegroupstaggingapi"` + // Use this to override the default service endpoint URL + Rolesanywhere pulumi.StringPtrInput `pulumi:"rolesanywhere"` + // Use this to override the default service endpoint URL + Route53 pulumi.StringPtrInput `pulumi:"route53"` + // Use this to override the default service endpoint URL + Route53domains pulumi.StringPtrInput `pulumi:"route53domains"` + // Use this to override the default service endpoint URL + Route53profiles pulumi.StringPtrInput `pulumi:"route53profiles"` + // Use this to override the default service endpoint URL + Route53recoverycontrolconfig pulumi.StringPtrInput `pulumi:"route53recoverycontrolconfig"` + // Use this to override the default service endpoint URL + Route53recoveryreadiness pulumi.StringPtrInput `pulumi:"route53recoveryreadiness"` + // Use this to override the default service endpoint URL + Route53resolver pulumi.StringPtrInput `pulumi:"route53resolver"` + // Use this to override the default service endpoint URL + Rum pulumi.StringPtrInput `pulumi:"rum"` + // Use this to override the default service endpoint URL + S3 pulumi.StringPtrInput `pulumi:"s3"` + // Use this to override the default service endpoint URL + S3api pulumi.StringPtrInput `pulumi:"s3api"` + // Use this to override the default service endpoint URL + S3control pulumi.StringPtrInput `pulumi:"s3control"` + // Use this to override the default service endpoint URL + S3outposts pulumi.StringPtrInput `pulumi:"s3outposts"` + // Use this to override the default service endpoint URL + S3tables pulumi.StringPtrInput `pulumi:"s3tables"` + // Use this to override the default service endpoint URL + Sagemaker pulumi.StringPtrInput `pulumi:"sagemaker"` + // Use this to override the default service endpoint URL + Scheduler pulumi.StringPtrInput `pulumi:"scheduler"` + // Use this to override the default service endpoint URL + Schemas pulumi.StringPtrInput `pulumi:"schemas"` + // Use this to override the default service endpoint URL + Sdb pulumi.StringPtrInput `pulumi:"sdb"` + // Use this to override the default service endpoint URL + Secretsmanager pulumi.StringPtrInput `pulumi:"secretsmanager"` + // Use this to override the default service endpoint URL + Securityhub pulumi.StringPtrInput `pulumi:"securityhub"` + // Use this to override the default service endpoint URL + Securitylake pulumi.StringPtrInput `pulumi:"securitylake"` + // Use this to override the default service endpoint URL + Serverlessapplicationrepository pulumi.StringPtrInput `pulumi:"serverlessapplicationrepository"` + // Use this to override the default service endpoint URL + Serverlessapprepo pulumi.StringPtrInput `pulumi:"serverlessapprepo"` + // Use this to override the default service endpoint URL + Serverlessrepo pulumi.StringPtrInput `pulumi:"serverlessrepo"` + // Use this to override the default service endpoint URL + Servicecatalog pulumi.StringPtrInput `pulumi:"servicecatalog"` + // Use this to override the default service endpoint URL + Servicecatalogappregistry pulumi.StringPtrInput `pulumi:"servicecatalogappregistry"` + // Use this to override the default service endpoint URL + Servicediscovery pulumi.StringPtrInput `pulumi:"servicediscovery"` + // Use this to override the default service endpoint URL + Servicequotas pulumi.StringPtrInput `pulumi:"servicequotas"` + // Use this to override the default service endpoint URL + Ses pulumi.StringPtrInput `pulumi:"ses"` + // Use this to override the default service endpoint URL + Sesv2 pulumi.StringPtrInput `pulumi:"sesv2"` + // Use this to override the default service endpoint URL + Sfn pulumi.StringPtrInput `pulumi:"sfn"` + // Use this to override the default service endpoint URL + Shield pulumi.StringPtrInput `pulumi:"shield"` + // Use this to override the default service endpoint URL + Signer pulumi.StringPtrInput `pulumi:"signer"` + // Use this to override the default service endpoint URL + Simpledb pulumi.StringPtrInput `pulumi:"simpledb"` + // Use this to override the default service endpoint URL + Sns pulumi.StringPtrInput `pulumi:"sns"` + // Use this to override the default service endpoint URL + Sqs pulumi.StringPtrInput `pulumi:"sqs"` + // Use this to override the default service endpoint URL + Ssm pulumi.StringPtrInput `pulumi:"ssm"` + // Use this to override the default service endpoint URL + Ssmcontacts pulumi.StringPtrInput `pulumi:"ssmcontacts"` + // Use this to override the default service endpoint URL + Ssmincidents pulumi.StringPtrInput `pulumi:"ssmincidents"` + // Use this to override the default service endpoint URL + Ssmquicksetup pulumi.StringPtrInput `pulumi:"ssmquicksetup"` + // Use this to override the default service endpoint URL + Ssmsap pulumi.StringPtrInput `pulumi:"ssmsap"` + // Use this to override the default service endpoint URL + Sso pulumi.StringPtrInput `pulumi:"sso"` + // Use this to override the default service endpoint URL + Ssoadmin pulumi.StringPtrInput `pulumi:"ssoadmin"` + // Use this to override the default service endpoint URL + Stepfunctions pulumi.StringPtrInput `pulumi:"stepfunctions"` + // Use this to override the default service endpoint URL + Storagegateway pulumi.StringPtrInput `pulumi:"storagegateway"` + // Use this to override the default service endpoint URL + Sts pulumi.StringPtrInput `pulumi:"sts"` + // Use this to override the default service endpoint URL + Swf pulumi.StringPtrInput `pulumi:"swf"` + // Use this to override the default service endpoint URL + Synthetics pulumi.StringPtrInput `pulumi:"synthetics"` + // Use this to override the default service endpoint URL + Taxsettings pulumi.StringPtrInput `pulumi:"taxsettings"` + // Use this to override the default service endpoint URL + Timestreaminfluxdb pulumi.StringPtrInput `pulumi:"timestreaminfluxdb"` + // Use this to override the default service endpoint URL + Timestreamquery pulumi.StringPtrInput `pulumi:"timestreamquery"` + // Use this to override the default service endpoint URL + Timestreamwrite pulumi.StringPtrInput `pulumi:"timestreamwrite"` + // Use this to override the default service endpoint URL + Transcribe pulumi.StringPtrInput `pulumi:"transcribe"` + // Use this to override the default service endpoint URL + Transcribeservice pulumi.StringPtrInput `pulumi:"transcribeservice"` + // Use this to override the default service endpoint URL + Transfer pulumi.StringPtrInput `pulumi:"transfer"` + // Use this to override the default service endpoint URL + Verifiedpermissions pulumi.StringPtrInput `pulumi:"verifiedpermissions"` + // Use this to override the default service endpoint URL + Vpclattice pulumi.StringPtrInput `pulumi:"vpclattice"` + // Use this to override the default service endpoint URL + Waf pulumi.StringPtrInput `pulumi:"waf"` + // Use this to override the default service endpoint URL + Wafregional pulumi.StringPtrInput `pulumi:"wafregional"` + // Use this to override the default service endpoint URL + Wafv2 pulumi.StringPtrInput `pulumi:"wafv2"` + // Use this to override the default service endpoint URL + Wellarchitected pulumi.StringPtrInput `pulumi:"wellarchitected"` + // Use this to override the default service endpoint URL + Worklink pulumi.StringPtrInput `pulumi:"worklink"` + // Use this to override the default service endpoint URL + Workspaces pulumi.StringPtrInput `pulumi:"workspaces"` + // Use this to override the default service endpoint URL + Workspacesweb pulumi.StringPtrInput `pulumi:"workspacesweb"` + // Use this to override the default service endpoint URL + Xray pulumi.StringPtrInput `pulumi:"xray"` +} + +func (ProviderEndpointArgs) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderEndpoint)(nil)).Elem() +} + +func (i ProviderEndpointArgs) ToProviderEndpointOutput() ProviderEndpointOutput { + return i.ToProviderEndpointOutputWithContext(context.Background()) +} + +func (i ProviderEndpointArgs) ToProviderEndpointOutputWithContext(ctx context.Context) ProviderEndpointOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderEndpointOutput) +} + +// ProviderEndpointArrayInput is an input type that accepts ProviderEndpointArray and ProviderEndpointArrayOutput values. +// You can construct a concrete instance of `ProviderEndpointArrayInput` via: +// +// ProviderEndpointArray{ ProviderEndpointArgs{...} } +type ProviderEndpointArrayInput interface { + pulumi.Input + + ToProviderEndpointArrayOutput() ProviderEndpointArrayOutput + ToProviderEndpointArrayOutputWithContext(context.Context) ProviderEndpointArrayOutput +} + +type ProviderEndpointArray []ProviderEndpointInput + +func (ProviderEndpointArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]ProviderEndpoint)(nil)).Elem() +} + +func (i ProviderEndpointArray) ToProviderEndpointArrayOutput() ProviderEndpointArrayOutput { + return i.ToProviderEndpointArrayOutputWithContext(context.Background()) +} + +func (i ProviderEndpointArray) ToProviderEndpointArrayOutputWithContext(ctx context.Context) ProviderEndpointArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderEndpointArrayOutput) +} + +type ProviderEndpointOutput struct{ *pulumi.OutputState } + +func (ProviderEndpointOutput) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderEndpoint)(nil)).Elem() +} + +func (o ProviderEndpointOutput) ToProviderEndpointOutput() ProviderEndpointOutput { + return o +} + +func (o ProviderEndpointOutput) ToProviderEndpointOutputWithContext(ctx context.Context) ProviderEndpointOutput { + return o +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Accessanalyzer() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Accessanalyzer }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Account() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Account }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Acm() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Acm }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Acmpca() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Acmpca }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Amg() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Amg }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Amp() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Amp }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Amplify() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Amplify }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Apigateway() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Apigateway }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Apigatewayv2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Apigatewayv2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appautoscaling() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appautoscaling }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appconfig() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appconfig }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appfabric() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appfabric }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appflow() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appflow }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appintegrations() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appintegrations }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appintegrationsservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appintegrationsservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Applicationautoscaling() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Applicationautoscaling }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Applicationinsights() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Applicationinsights }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Applicationsignals() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Applicationsignals }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appmesh() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appmesh }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appregistry() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appregistry }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Apprunner() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Apprunner }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appstream() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appstream }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Appsync() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Appsync }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Athena() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Athena }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Auditmanager() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Auditmanager }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Autoscaling() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Autoscaling }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Autoscalingplans() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Autoscalingplans }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Backup() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Backup }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Batch() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Batch }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Bcmdataexports() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Bcmdataexports }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Beanstalk() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Beanstalk }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Bedrock() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Bedrock }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Bedrockagent() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Bedrockagent }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Billing() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Billing }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Budgets() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Budgets }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ce() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ce }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Chatbot() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Chatbot }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Chime() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Chime }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Chimesdkmediapipelines() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Chimesdkmediapipelines }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Chimesdkvoice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Chimesdkvoice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cleanrooms() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cleanrooms }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloud9() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloud9 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudcontrol() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudcontrol }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudcontrolapi() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudcontrolapi }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudformation() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudformation }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudfront() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudfront }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudfrontkeyvaluestore() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudfrontkeyvaluestore }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudhsm() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudhsm }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudhsmv2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudhsmv2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudsearch() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudsearch }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudtrail() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudtrail }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudwatch() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudwatch }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudwatchevents() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudwatchevents }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudwatchevidently() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudwatchevidently }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudwatchlog() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudwatchlog }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudwatchlogs() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudwatchlogs }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudwatchobservabilityaccessmanager() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudwatchobservabilityaccessmanager }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cloudwatchrum() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cloudwatchrum }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codeartifact() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codeartifact }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codebuild() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codebuild }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codecatalyst() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codecatalyst }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codecommit() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codecommit }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codeconnections() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codeconnections }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codedeploy() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codedeploy }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codeguruprofiler() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codeguruprofiler }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codegurureviewer() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codegurureviewer }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codepipeline() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codepipeline }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codestarconnections() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codestarconnections }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Codestarnotifications() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Codestarnotifications }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cognitoidentity() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cognitoidentity }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cognitoidentityprovider() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cognitoidentityprovider }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cognitoidp() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cognitoidp }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Comprehend() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Comprehend }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Computeoptimizer() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Computeoptimizer }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Config() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Config }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Configservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Configservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Connect() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Connect }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Connectcases() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Connectcases }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Controltower() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Controltower }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Costandusagereportservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Costandusagereportservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Costexplorer() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Costexplorer }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Costoptimizationhub() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Costoptimizationhub }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Cur() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Cur }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Customerprofiles() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Customerprofiles }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Databasemigration() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Databasemigration }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Databasemigrationservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Databasemigrationservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Databrew() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Databrew }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Dataexchange() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Dataexchange }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Datapipeline() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Datapipeline }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Datasync() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Datasync }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Datazone() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Datazone }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Dax() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Dax }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Deploy() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Deploy }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Detective() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Detective }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Devicefarm() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Devicefarm }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Devopsguru() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Devopsguru }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Directconnect() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Directconnect }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Directoryservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Directoryservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Dlm() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Dlm }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Dms() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Dms }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Docdb() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Docdb }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Docdbelastic() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Docdbelastic }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Drs() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Drs }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ds() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ds }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Dsql() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Dsql }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Dynamodb() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Dynamodb }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ec2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ec2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ecr() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ecr }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ecrpublic() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ecrpublic }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ecs() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ecs }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Efs() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Efs }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Eks() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Eks }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Elasticache() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Elasticache }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Elasticbeanstalk() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Elasticbeanstalk }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Elasticloadbalancing() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Elasticloadbalancing }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Elasticloadbalancingv2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Elasticloadbalancingv2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Elasticsearch() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Elasticsearch }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Elasticsearchservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Elasticsearchservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Elastictranscoder() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Elastictranscoder }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Elb() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Elb }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Elbv2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Elbv2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Emr() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Emr }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Emrcontainers() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Emrcontainers }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Emrserverless() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Emrserverless }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Es() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Es }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Eventbridge() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Eventbridge }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Events() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Events }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Evidently() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Evidently }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Finspace() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Finspace }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Firehose() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Firehose }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Fis() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Fis }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Fms() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Fms }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Fsx() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Fsx }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Gamelift() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Gamelift }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Glacier() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Glacier }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Globalaccelerator() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Globalaccelerator }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Glue() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Glue }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Gluedatabrew() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Gluedatabrew }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Grafana() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Grafana }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Greengrass() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Greengrass }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Groundstation() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Groundstation }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Guardduty() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Guardduty }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Healthlake() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Healthlake }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Iam() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Iam }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Identitystore() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Identitystore }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Imagebuilder() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Imagebuilder }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Inspector() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Inspector }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Inspector2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Inspector2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Inspectorv2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Inspectorv2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Internetmonitor() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Internetmonitor }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Invoicing() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Invoicing }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Iot() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Iot }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Iotanalytics() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Iotanalytics }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Iotevents() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Iotevents }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ivs() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ivs }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ivschat() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ivschat }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Kafka() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Kafka }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Kafkaconnect() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Kafkaconnect }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Kendra() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Kendra }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Keyspaces() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Keyspaces }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Kinesis() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Kinesis }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Kinesisanalytics() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Kinesisanalytics }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Kinesisanalyticsv2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Kinesisanalyticsv2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Kinesisvideo() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Kinesisvideo }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Kms() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Kms }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lakeformation() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lakeformation }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lambda() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lambda }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Launchwizard() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Launchwizard }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lex() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lex }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lexmodelbuilding() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lexmodelbuilding }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lexmodelbuildingservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lexmodelbuildingservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lexmodels() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lexmodels }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lexmodelsv2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lexmodelsv2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lexv2models() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lexv2models }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Licensemanager() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Licensemanager }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lightsail() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lightsail }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Location() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Location }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Locationservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Locationservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Logs() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Logs }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Lookoutmetrics() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Lookoutmetrics }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) M2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.M2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Macie2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Macie2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Managedgrafana() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Managedgrafana }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Mediaconnect() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Mediaconnect }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Mediaconvert() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Mediaconvert }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Medialive() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Medialive }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Mediapackage() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Mediapackage }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Mediapackagev2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Mediapackagev2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Mediapackagevod() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Mediapackagevod }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Mediastore() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Mediastore }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Memorydb() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Memorydb }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Mgn() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Mgn }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Mq() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Mq }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Msk() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Msk }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Mwaa() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Mwaa }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Neptune() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Neptune }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Neptunegraph() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Neptunegraph }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Networkfirewall() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Networkfirewall }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Networkmanager() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Networkmanager }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Networkmonitor() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Networkmonitor }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Oam() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Oam }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Opensearch() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Opensearch }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Opensearchingestion() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Opensearchingestion }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Opensearchserverless() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Opensearchserverless }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Opensearchservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Opensearchservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Opsworks() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Opsworks }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Organizations() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Organizations }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Osis() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Osis }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Outposts() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Outposts }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Paymentcryptography() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Paymentcryptography }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Pcaconnectorad() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Pcaconnectorad }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Pcs() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Pcs }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Pinpoint() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Pinpoint }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Pinpointsmsvoicev2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Pinpointsmsvoicev2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Pipes() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Pipes }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Polly() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Polly }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Pricing() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Pricing }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Prometheus() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Prometheus }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Prometheusservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Prometheusservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Qbusiness() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Qbusiness }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Qldb() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Qldb }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Quicksight() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Quicksight }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ram() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ram }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Rbin() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Rbin }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Rds() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Rds }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Recyclebin() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Recyclebin }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Redshift() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Redshift }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Redshiftdata() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Redshiftdata }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Redshiftdataapiservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Redshiftdataapiservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Redshiftserverless() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Redshiftserverless }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Rekognition() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Rekognition }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Resiliencehub() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Resiliencehub }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Resourceexplorer2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Resourceexplorer2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Resourcegroups() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Resourcegroups }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Resourcegroupstagging() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Resourcegroupstagging }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Resourcegroupstaggingapi() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Resourcegroupstaggingapi }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Rolesanywhere() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Rolesanywhere }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Route53() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Route53 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Route53domains() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Route53domains }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Route53profiles() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Route53profiles }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Route53recoverycontrolconfig() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Route53recoverycontrolconfig }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Route53recoveryreadiness() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Route53recoveryreadiness }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Route53resolver() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Route53resolver }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Rum() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Rum }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) S3() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.S3 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) S3api() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.S3api }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) S3control() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.S3control }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) S3outposts() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.S3outposts }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) S3tables() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.S3tables }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Sagemaker() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Sagemaker }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Scheduler() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Scheduler }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Schemas() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Schemas }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Sdb() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Sdb }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Secretsmanager() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Secretsmanager }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Securityhub() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Securityhub }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Securitylake() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Securitylake }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Serverlessapplicationrepository() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Serverlessapplicationrepository }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Serverlessapprepo() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Serverlessapprepo }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Serverlessrepo() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Serverlessrepo }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Servicecatalog() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Servicecatalog }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Servicecatalogappregistry() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Servicecatalogappregistry }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Servicediscovery() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Servicediscovery }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Servicequotas() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Servicequotas }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ses() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ses }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Sesv2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Sesv2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Sfn() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Sfn }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Shield() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Shield }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Signer() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Signer }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Simpledb() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Simpledb }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Sns() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Sns }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Sqs() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Sqs }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ssm() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ssm }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ssmcontacts() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ssmcontacts }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ssmincidents() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ssmincidents }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ssmquicksetup() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ssmquicksetup }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ssmsap() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ssmsap }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Sso() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Sso }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Ssoadmin() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Ssoadmin }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Stepfunctions() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Stepfunctions }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Storagegateway() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Storagegateway }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Sts() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Sts }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Swf() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Swf }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Synthetics() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Synthetics }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Taxsettings() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Taxsettings }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Timestreaminfluxdb() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Timestreaminfluxdb }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Timestreamquery() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Timestreamquery }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Timestreamwrite() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Timestreamwrite }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Transcribe() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Transcribe }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Transcribeservice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Transcribeservice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Transfer() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Transfer }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Verifiedpermissions() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Verifiedpermissions }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Vpclattice() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Vpclattice }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Waf() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Waf }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Wafregional() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Wafregional }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Wafv2() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Wafv2 }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Wellarchitected() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Wellarchitected }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Worklink() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Worklink }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Workspaces() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Workspaces }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Workspacesweb() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Workspacesweb }).(pulumi.StringPtrOutput) +} + +// Use this to override the default service endpoint URL +func (o ProviderEndpointOutput) Xray() pulumi.StringPtrOutput { + return o.ApplyT(func(v ProviderEndpoint) *string { return v.Xray }).(pulumi.StringPtrOutput) +} + +type ProviderEndpointArrayOutput struct{ *pulumi.OutputState } + +func (ProviderEndpointArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]ProviderEndpoint)(nil)).Elem() +} + +func (o ProviderEndpointArrayOutput) ToProviderEndpointArrayOutput() ProviderEndpointArrayOutput { + return o +} + +func (o ProviderEndpointArrayOutput) ToProviderEndpointArrayOutputWithContext(ctx context.Context) ProviderEndpointArrayOutput { + return o +} + +func (o ProviderEndpointArrayOutput) Index(i pulumi.IntInput) ProviderEndpointOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) ProviderEndpoint { + return vs[0].([]ProviderEndpoint)[vs[1].(int)] + }).(ProviderEndpointOutput) +} + +type ProviderIgnoreTags struct { + // Resource tag key prefixes to ignore across all resources. Can also be configured with the TF_AWS_IGNORE_TAGS_KEY_PREFIXES environment variable. + KeyPrefixes []string `pulumi:"keyPrefixes"` + // Resource tag keys to ignore across all resources. Can also be configured with the TF_AWS_IGNORE_TAGS_KEYS environment variable. + Keys []string `pulumi:"keys"` +} + +// ProviderIgnoreTagsInput is an input type that accepts ProviderIgnoreTagsArgs and ProviderIgnoreTagsOutput values. +// You can construct a concrete instance of `ProviderIgnoreTagsInput` via: +// +// ProviderIgnoreTagsArgs{...} +type ProviderIgnoreTagsInput interface { + pulumi.Input + + ToProviderIgnoreTagsOutput() ProviderIgnoreTagsOutput + ToProviderIgnoreTagsOutputWithContext(context.Context) ProviderIgnoreTagsOutput +} + +type ProviderIgnoreTagsArgs struct { + // Resource tag key prefixes to ignore across all resources. Can also be configured with the TF_AWS_IGNORE_TAGS_KEY_PREFIXES environment variable. + KeyPrefixes pulumi.StringArrayInput `pulumi:"keyPrefixes"` + // Resource tag keys to ignore across all resources. Can also be configured with the TF_AWS_IGNORE_TAGS_KEYS environment variable. + Keys pulumi.StringArrayInput `pulumi:"keys"` +} + +func (ProviderIgnoreTagsArgs) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderIgnoreTags)(nil)).Elem() +} + +func (i ProviderIgnoreTagsArgs) ToProviderIgnoreTagsOutput() ProviderIgnoreTagsOutput { + return i.ToProviderIgnoreTagsOutputWithContext(context.Background()) +} + +func (i ProviderIgnoreTagsArgs) ToProviderIgnoreTagsOutputWithContext(ctx context.Context) ProviderIgnoreTagsOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderIgnoreTagsOutput) +} + +func (i ProviderIgnoreTagsArgs) ToProviderIgnoreTagsPtrOutput() ProviderIgnoreTagsPtrOutput { + return i.ToProviderIgnoreTagsPtrOutputWithContext(context.Background()) +} + +func (i ProviderIgnoreTagsArgs) ToProviderIgnoreTagsPtrOutputWithContext(ctx context.Context) ProviderIgnoreTagsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderIgnoreTagsOutput).ToProviderIgnoreTagsPtrOutputWithContext(ctx) +} + +// ProviderIgnoreTagsPtrInput is an input type that accepts ProviderIgnoreTagsArgs, ProviderIgnoreTagsPtr and ProviderIgnoreTagsPtrOutput values. +// You can construct a concrete instance of `ProviderIgnoreTagsPtrInput` via: +// +// ProviderIgnoreTagsArgs{...} +// +// or: +// +// nil +type ProviderIgnoreTagsPtrInput interface { + pulumi.Input + + ToProviderIgnoreTagsPtrOutput() ProviderIgnoreTagsPtrOutput + ToProviderIgnoreTagsPtrOutputWithContext(context.Context) ProviderIgnoreTagsPtrOutput +} + +type providerIgnoreTagsPtrType ProviderIgnoreTagsArgs + +func ProviderIgnoreTagsPtr(v *ProviderIgnoreTagsArgs) ProviderIgnoreTagsPtrInput { + return (*providerIgnoreTagsPtrType)(v) +} + +func (*providerIgnoreTagsPtrType) ElementType() reflect.Type { + return reflect.TypeOf((**ProviderIgnoreTags)(nil)).Elem() +} + +func (i *providerIgnoreTagsPtrType) ToProviderIgnoreTagsPtrOutput() ProviderIgnoreTagsPtrOutput { + return i.ToProviderIgnoreTagsPtrOutputWithContext(context.Background()) +} + +func (i *providerIgnoreTagsPtrType) ToProviderIgnoreTagsPtrOutputWithContext(ctx context.Context) ProviderIgnoreTagsPtrOutput { + return pulumi.ToOutputWithContext(ctx, i).(ProviderIgnoreTagsPtrOutput) +} + +type ProviderIgnoreTagsOutput struct{ *pulumi.OutputState } + +func (ProviderIgnoreTagsOutput) ElementType() reflect.Type { + return reflect.TypeOf((*ProviderIgnoreTags)(nil)).Elem() +} + +func (o ProviderIgnoreTagsOutput) ToProviderIgnoreTagsOutput() ProviderIgnoreTagsOutput { + return o +} + +func (o ProviderIgnoreTagsOutput) ToProviderIgnoreTagsOutputWithContext(ctx context.Context) ProviderIgnoreTagsOutput { + return o +} + +func (o ProviderIgnoreTagsOutput) ToProviderIgnoreTagsPtrOutput() ProviderIgnoreTagsPtrOutput { + return o.ToProviderIgnoreTagsPtrOutputWithContext(context.Background()) +} + +func (o ProviderIgnoreTagsOutput) ToProviderIgnoreTagsPtrOutputWithContext(ctx context.Context) ProviderIgnoreTagsPtrOutput { + return o.ApplyTWithContext(ctx, func(_ context.Context, v ProviderIgnoreTags) *ProviderIgnoreTags { + return &v + }).(ProviderIgnoreTagsPtrOutput) +} + +// Resource tag key prefixes to ignore across all resources. Can also be configured with the TF_AWS_IGNORE_TAGS_KEY_PREFIXES environment variable. +func (o ProviderIgnoreTagsOutput) KeyPrefixes() pulumi.StringArrayOutput { + return o.ApplyT(func(v ProviderIgnoreTags) []string { return v.KeyPrefixes }).(pulumi.StringArrayOutput) +} + +// Resource tag keys to ignore across all resources. Can also be configured with the TF_AWS_IGNORE_TAGS_KEYS environment variable. +func (o ProviderIgnoreTagsOutput) Keys() pulumi.StringArrayOutput { + return o.ApplyT(func(v ProviderIgnoreTags) []string { return v.Keys }).(pulumi.StringArrayOutput) +} + +type ProviderIgnoreTagsPtrOutput struct{ *pulumi.OutputState } + +func (ProviderIgnoreTagsPtrOutput) ElementType() reflect.Type { + return reflect.TypeOf((**ProviderIgnoreTags)(nil)).Elem() +} + +func (o ProviderIgnoreTagsPtrOutput) ToProviderIgnoreTagsPtrOutput() ProviderIgnoreTagsPtrOutput { + return o +} + +func (o ProviderIgnoreTagsPtrOutput) ToProviderIgnoreTagsPtrOutputWithContext(ctx context.Context) ProviderIgnoreTagsPtrOutput { + return o +} + +func (o ProviderIgnoreTagsPtrOutput) Elem() ProviderIgnoreTagsOutput { + return o.ApplyT(func(v *ProviderIgnoreTags) ProviderIgnoreTags { + if v != nil { + return *v + } + var ret ProviderIgnoreTags + return ret + }).(ProviderIgnoreTagsOutput) +} + +// Resource tag key prefixes to ignore across all resources. Can also be configured with the TF_AWS_IGNORE_TAGS_KEY_PREFIXES environment variable. +func (o ProviderIgnoreTagsPtrOutput) KeyPrefixes() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ProviderIgnoreTags) []string { + if v == nil { + return nil + } + return v.KeyPrefixes + }).(pulumi.StringArrayOutput) +} + +// Resource tag keys to ignore across all resources. Can also be configured with the TF_AWS_IGNORE_TAGS_KEYS environment variable. +func (o ProviderIgnoreTagsPtrOutput) Keys() pulumi.StringArrayOutput { + return o.ApplyT(func(v *ProviderIgnoreTags) []string { + if v == nil { + return nil + } + return v.Keys + }).(pulumi.StringArrayOutput) +} + +type GetAvailabilityZoneFilter struct { + // Name of the filter field. Valid values can be found in the [EC2 DescribeAvailabilityZones API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html). + Name string `pulumi:"name"` + // Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + Values []string `pulumi:"values"` +} + +// GetAvailabilityZoneFilterInput is an input type that accepts GetAvailabilityZoneFilterArgs and GetAvailabilityZoneFilterOutput values. +// You can construct a concrete instance of `GetAvailabilityZoneFilterInput` via: +// +// GetAvailabilityZoneFilterArgs{...} +type GetAvailabilityZoneFilterInput interface { + pulumi.Input + + ToGetAvailabilityZoneFilterOutput() GetAvailabilityZoneFilterOutput + ToGetAvailabilityZoneFilterOutputWithContext(context.Context) GetAvailabilityZoneFilterOutput +} + +type GetAvailabilityZoneFilterArgs struct { + // Name of the filter field. Valid values can be found in the [EC2 DescribeAvailabilityZones API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html). + Name pulumi.StringInput `pulumi:"name"` + // Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + Values pulumi.StringArrayInput `pulumi:"values"` +} + +func (GetAvailabilityZoneFilterArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetAvailabilityZoneFilter)(nil)).Elem() +} + +func (i GetAvailabilityZoneFilterArgs) ToGetAvailabilityZoneFilterOutput() GetAvailabilityZoneFilterOutput { + return i.ToGetAvailabilityZoneFilterOutputWithContext(context.Background()) +} + +func (i GetAvailabilityZoneFilterArgs) ToGetAvailabilityZoneFilterOutputWithContext(ctx context.Context) GetAvailabilityZoneFilterOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetAvailabilityZoneFilterOutput) +} + +// GetAvailabilityZoneFilterArrayInput is an input type that accepts GetAvailabilityZoneFilterArray and GetAvailabilityZoneFilterArrayOutput values. +// You can construct a concrete instance of `GetAvailabilityZoneFilterArrayInput` via: +// +// GetAvailabilityZoneFilterArray{ GetAvailabilityZoneFilterArgs{...} } +type GetAvailabilityZoneFilterArrayInput interface { + pulumi.Input + + ToGetAvailabilityZoneFilterArrayOutput() GetAvailabilityZoneFilterArrayOutput + ToGetAvailabilityZoneFilterArrayOutputWithContext(context.Context) GetAvailabilityZoneFilterArrayOutput +} + +type GetAvailabilityZoneFilterArray []GetAvailabilityZoneFilterInput + +func (GetAvailabilityZoneFilterArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetAvailabilityZoneFilter)(nil)).Elem() +} + +func (i GetAvailabilityZoneFilterArray) ToGetAvailabilityZoneFilterArrayOutput() GetAvailabilityZoneFilterArrayOutput { + return i.ToGetAvailabilityZoneFilterArrayOutputWithContext(context.Background()) +} + +func (i GetAvailabilityZoneFilterArray) ToGetAvailabilityZoneFilterArrayOutputWithContext(ctx context.Context) GetAvailabilityZoneFilterArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetAvailabilityZoneFilterArrayOutput) +} + +type GetAvailabilityZoneFilterOutput struct{ *pulumi.OutputState } + +func (GetAvailabilityZoneFilterOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetAvailabilityZoneFilter)(nil)).Elem() +} + +func (o GetAvailabilityZoneFilterOutput) ToGetAvailabilityZoneFilterOutput() GetAvailabilityZoneFilterOutput { + return o +} + +func (o GetAvailabilityZoneFilterOutput) ToGetAvailabilityZoneFilterOutputWithContext(ctx context.Context) GetAvailabilityZoneFilterOutput { + return o +} + +// Name of the filter field. Valid values can be found in the [EC2 DescribeAvailabilityZones API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html). +func (o GetAvailabilityZoneFilterOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZoneFilter) string { return v.Name }).(pulumi.StringOutput) +} + +// Set of values that are accepted for the given filter field. Results will be selected if any given value matches. +func (o GetAvailabilityZoneFilterOutput) Values() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetAvailabilityZoneFilter) []string { return v.Values }).(pulumi.StringArrayOutput) +} + +type GetAvailabilityZoneFilterArrayOutput struct{ *pulumi.OutputState } + +func (GetAvailabilityZoneFilterArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetAvailabilityZoneFilter)(nil)).Elem() +} + +func (o GetAvailabilityZoneFilterArrayOutput) ToGetAvailabilityZoneFilterArrayOutput() GetAvailabilityZoneFilterArrayOutput { + return o +} + +func (o GetAvailabilityZoneFilterArrayOutput) ToGetAvailabilityZoneFilterArrayOutputWithContext(ctx context.Context) GetAvailabilityZoneFilterArrayOutput { + return o +} + +func (o GetAvailabilityZoneFilterArrayOutput) Index(i pulumi.IntInput) GetAvailabilityZoneFilterOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetAvailabilityZoneFilter { + return vs[0].([]GetAvailabilityZoneFilter)[vs[1].(int)] + }).(GetAvailabilityZoneFilterOutput) +} + +type GetAvailabilityZonesFilter struct { + // Name of the filter field. Valid values can be found in the [EC2 DescribeAvailabilityZones API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html). + Name string `pulumi:"name"` + // Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + Values []string `pulumi:"values"` +} + +// GetAvailabilityZonesFilterInput is an input type that accepts GetAvailabilityZonesFilterArgs and GetAvailabilityZonesFilterOutput values. +// You can construct a concrete instance of `GetAvailabilityZonesFilterInput` via: +// +// GetAvailabilityZonesFilterArgs{...} +type GetAvailabilityZonesFilterInput interface { + pulumi.Input + + ToGetAvailabilityZonesFilterOutput() GetAvailabilityZonesFilterOutput + ToGetAvailabilityZonesFilterOutputWithContext(context.Context) GetAvailabilityZonesFilterOutput +} + +type GetAvailabilityZonesFilterArgs struct { + // Name of the filter field. Valid values can be found in the [EC2 DescribeAvailabilityZones API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html). + Name pulumi.StringInput `pulumi:"name"` + // Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + Values pulumi.StringArrayInput `pulumi:"values"` +} + +func (GetAvailabilityZonesFilterArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetAvailabilityZonesFilter)(nil)).Elem() +} + +func (i GetAvailabilityZonesFilterArgs) ToGetAvailabilityZonesFilterOutput() GetAvailabilityZonesFilterOutput { + return i.ToGetAvailabilityZonesFilterOutputWithContext(context.Background()) +} + +func (i GetAvailabilityZonesFilterArgs) ToGetAvailabilityZonesFilterOutputWithContext(ctx context.Context) GetAvailabilityZonesFilterOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetAvailabilityZonesFilterOutput) +} + +// GetAvailabilityZonesFilterArrayInput is an input type that accepts GetAvailabilityZonesFilterArray and GetAvailabilityZonesFilterArrayOutput values. +// You can construct a concrete instance of `GetAvailabilityZonesFilterArrayInput` via: +// +// GetAvailabilityZonesFilterArray{ GetAvailabilityZonesFilterArgs{...} } +type GetAvailabilityZonesFilterArrayInput interface { + pulumi.Input + + ToGetAvailabilityZonesFilterArrayOutput() GetAvailabilityZonesFilterArrayOutput + ToGetAvailabilityZonesFilterArrayOutputWithContext(context.Context) GetAvailabilityZonesFilterArrayOutput +} + +type GetAvailabilityZonesFilterArray []GetAvailabilityZonesFilterInput + +func (GetAvailabilityZonesFilterArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetAvailabilityZonesFilter)(nil)).Elem() +} + +func (i GetAvailabilityZonesFilterArray) ToGetAvailabilityZonesFilterArrayOutput() GetAvailabilityZonesFilterArrayOutput { + return i.ToGetAvailabilityZonesFilterArrayOutputWithContext(context.Background()) +} + +func (i GetAvailabilityZonesFilterArray) ToGetAvailabilityZonesFilterArrayOutputWithContext(ctx context.Context) GetAvailabilityZonesFilterArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetAvailabilityZonesFilterArrayOutput) +} + +type GetAvailabilityZonesFilterOutput struct{ *pulumi.OutputState } + +func (GetAvailabilityZonesFilterOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetAvailabilityZonesFilter)(nil)).Elem() +} + +func (o GetAvailabilityZonesFilterOutput) ToGetAvailabilityZonesFilterOutput() GetAvailabilityZonesFilterOutput { + return o +} + +func (o GetAvailabilityZonesFilterOutput) ToGetAvailabilityZonesFilterOutputWithContext(ctx context.Context) GetAvailabilityZonesFilterOutput { + return o +} + +// Name of the filter field. Valid values can be found in the [EC2 DescribeAvailabilityZones API Reference](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html). +func (o GetAvailabilityZonesFilterOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetAvailabilityZonesFilter) string { return v.Name }).(pulumi.StringOutput) +} + +// Set of values that are accepted for the given filter field. Results will be selected if any given value matches. +func (o GetAvailabilityZonesFilterOutput) Values() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetAvailabilityZonesFilter) []string { return v.Values }).(pulumi.StringArrayOutput) +} + +type GetAvailabilityZonesFilterArrayOutput struct{ *pulumi.OutputState } + +func (GetAvailabilityZonesFilterArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetAvailabilityZonesFilter)(nil)).Elem() +} + +func (o GetAvailabilityZonesFilterArrayOutput) ToGetAvailabilityZonesFilterArrayOutput() GetAvailabilityZonesFilterArrayOutput { + return o +} + +func (o GetAvailabilityZonesFilterArrayOutput) ToGetAvailabilityZonesFilterArrayOutputWithContext(ctx context.Context) GetAvailabilityZonesFilterArrayOutput { + return o +} + +func (o GetAvailabilityZonesFilterArrayOutput) Index(i pulumi.IntInput) GetAvailabilityZonesFilterOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetAvailabilityZonesFilter { + return vs[0].([]GetAvailabilityZonesFilter)[vs[1].(int)] + }).(GetAvailabilityZonesFilterOutput) +} + +type GetRegionsFilter struct { + // Name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1]. + Name string `pulumi:"name"` + // Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + Values []string `pulumi:"values"` +} + +// GetRegionsFilterInput is an input type that accepts GetRegionsFilterArgs and GetRegionsFilterOutput values. +// You can construct a concrete instance of `GetRegionsFilterInput` via: +// +// GetRegionsFilterArgs{...} +type GetRegionsFilterInput interface { + pulumi.Input + + ToGetRegionsFilterOutput() GetRegionsFilterOutput + ToGetRegionsFilterOutputWithContext(context.Context) GetRegionsFilterOutput +} + +type GetRegionsFilterArgs struct { + // Name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1]. + Name pulumi.StringInput `pulumi:"name"` + // Set of values that are accepted for the given filter field. Results will be selected if any given value matches. + Values pulumi.StringArrayInput `pulumi:"values"` +} + +func (GetRegionsFilterArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetRegionsFilter)(nil)).Elem() +} + +func (i GetRegionsFilterArgs) ToGetRegionsFilterOutput() GetRegionsFilterOutput { + return i.ToGetRegionsFilterOutputWithContext(context.Background()) +} + +func (i GetRegionsFilterArgs) ToGetRegionsFilterOutputWithContext(ctx context.Context) GetRegionsFilterOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetRegionsFilterOutput) +} + +// GetRegionsFilterArrayInput is an input type that accepts GetRegionsFilterArray and GetRegionsFilterArrayOutput values. +// You can construct a concrete instance of `GetRegionsFilterArrayInput` via: +// +// GetRegionsFilterArray{ GetRegionsFilterArgs{...} } +type GetRegionsFilterArrayInput interface { + pulumi.Input + + ToGetRegionsFilterArrayOutput() GetRegionsFilterArrayOutput + ToGetRegionsFilterArrayOutputWithContext(context.Context) GetRegionsFilterArrayOutput +} + +type GetRegionsFilterArray []GetRegionsFilterInput + +func (GetRegionsFilterArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetRegionsFilter)(nil)).Elem() +} + +func (i GetRegionsFilterArray) ToGetRegionsFilterArrayOutput() GetRegionsFilterArrayOutput { + return i.ToGetRegionsFilterArrayOutputWithContext(context.Background()) +} + +func (i GetRegionsFilterArray) ToGetRegionsFilterArrayOutputWithContext(ctx context.Context) GetRegionsFilterArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetRegionsFilterArrayOutput) +} + +type GetRegionsFilterOutput struct{ *pulumi.OutputState } + +func (GetRegionsFilterOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetRegionsFilter)(nil)).Elem() +} + +func (o GetRegionsFilterOutput) ToGetRegionsFilterOutput() GetRegionsFilterOutput { + return o +} + +func (o GetRegionsFilterOutput) ToGetRegionsFilterOutputWithContext(ctx context.Context) GetRegionsFilterOutput { + return o +} + +// Name of the filter field. Valid values can be found in the [describe-regions AWS CLI Reference][1]. +func (o GetRegionsFilterOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetRegionsFilter) string { return v.Name }).(pulumi.StringOutput) +} + +// Set of values that are accepted for the given filter field. Results will be selected if any given value matches. +func (o GetRegionsFilterOutput) Values() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetRegionsFilter) []string { return v.Values }).(pulumi.StringArrayOutput) +} + +type GetRegionsFilterArrayOutput struct{ *pulumi.OutputState } + +func (GetRegionsFilterArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetRegionsFilter)(nil)).Elem() +} + +func (o GetRegionsFilterArrayOutput) ToGetRegionsFilterArrayOutput() GetRegionsFilterArrayOutput { + return o +} + +func (o GetRegionsFilterArrayOutput) ToGetRegionsFilterArrayOutputWithContext(ctx context.Context) GetRegionsFilterArrayOutput { + return o +} + +func (o GetRegionsFilterArrayOutput) Index(i pulumi.IntInput) GetRegionsFilterOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetRegionsFilter { + return vs[0].([]GetRegionsFilter)[vs[1].(int)] + }).(GetRegionsFilterOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*ProviderAssumeRoleInput)(nil)).Elem(), ProviderAssumeRoleArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*ProviderAssumeRolePtrInput)(nil)).Elem(), ProviderAssumeRoleArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*ProviderAssumeRoleWithWebIdentityInput)(nil)).Elem(), ProviderAssumeRoleWithWebIdentityArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*ProviderAssumeRoleWithWebIdentityPtrInput)(nil)).Elem(), ProviderAssumeRoleWithWebIdentityArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*ProviderDefaultTagsInput)(nil)).Elem(), ProviderDefaultTagsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*ProviderDefaultTagsPtrInput)(nil)).Elem(), ProviderDefaultTagsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*ProviderEndpointInput)(nil)).Elem(), ProviderEndpointArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*ProviderEndpointArrayInput)(nil)).Elem(), ProviderEndpointArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*ProviderIgnoreTagsInput)(nil)).Elem(), ProviderIgnoreTagsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*ProviderIgnoreTagsPtrInput)(nil)).Elem(), ProviderIgnoreTagsArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetAvailabilityZoneFilterInput)(nil)).Elem(), GetAvailabilityZoneFilterArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetAvailabilityZoneFilterArrayInput)(nil)).Elem(), GetAvailabilityZoneFilterArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetAvailabilityZonesFilterInput)(nil)).Elem(), GetAvailabilityZonesFilterArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetAvailabilityZonesFilterArrayInput)(nil)).Elem(), GetAvailabilityZonesFilterArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetRegionsFilterInput)(nil)).Elem(), GetRegionsFilterArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetRegionsFilterArrayInput)(nil)).Elem(), GetRegionsFilterArray{}) + pulumi.RegisterOutputType(ProviderAssumeRoleOutput{}) + pulumi.RegisterOutputType(ProviderAssumeRolePtrOutput{}) + pulumi.RegisterOutputType(ProviderAssumeRoleWithWebIdentityOutput{}) + pulumi.RegisterOutputType(ProviderAssumeRoleWithWebIdentityPtrOutput{}) + pulumi.RegisterOutputType(ProviderDefaultTagsOutput{}) + pulumi.RegisterOutputType(ProviderDefaultTagsPtrOutput{}) + pulumi.RegisterOutputType(ProviderEndpointOutput{}) + pulumi.RegisterOutputType(ProviderEndpointArrayOutput{}) + pulumi.RegisterOutputType(ProviderIgnoreTagsOutput{}) + pulumi.RegisterOutputType(ProviderIgnoreTagsPtrOutput{}) + pulumi.RegisterOutputType(GetAvailabilityZoneFilterOutput{}) + pulumi.RegisterOutputType(GetAvailabilityZoneFilterArrayOutput{}) + pulumi.RegisterOutputType(GetAvailabilityZonesFilterOutput{}) + pulumi.RegisterOutputType(GetAvailabilityZonesFilterArrayOutput{}) + pulumi.RegisterOutputType(GetRegionsFilterOutput{}) + pulumi.RegisterOutputType(GetRegionsFilterArrayOutput{}) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index e246c5f30..ec0f69158 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -216,6 +216,11 @@ github.com/aws/aws-sdk-go-v2/service/internal/s3shared/config github.com/aws/aws-sdk-go-v2/service/pricing github.com/aws/aws-sdk-go-v2/service/pricing/internal/endpoints github.com/aws/aws-sdk-go-v2/service/pricing/types +# github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.26.3 +## explicit; go 1.22 +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi/types # github.com/aws/aws-sdk-go-v2/service/s3 v1.79.3 ## explicit; go 1.22 github.com/aws/aws-sdk-go-v2/service/s3 @@ -569,6 +574,7 @@ github.com/pulumi/pulumi-aws-native/sdk/go/aws/scheduler github.com/pulumi/pulumi-aws-native/sdk/go/aws/ssm # github.com/pulumi/pulumi-aws/sdk/v6 v6.81.0 ## explicit; go 1.22 +github.com/pulumi/pulumi-aws/sdk/v6/go/aws github.com/pulumi/pulumi-aws/sdk/v6/go/aws/autoscaling github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2