Skip to content

Commit

Permalink
globalaccelerator
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Jun 7, 2024
1 parent 8f7528e commit c6ac504
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 5 additions & 1 deletion internal/generate/serviceendpointtests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,13 @@ func main() {
}
}

if td.OverrideRegion == "us-west-2" {
td.Region = "us-east-1"
}

switch packageName {
// TODO: This case should be handled in service data
case "costoptimizationhub", "cur", "route53domains":
case "costoptimizationhub", "cur", "globalaccelerator", "route53domains":
td.OverrideRegionRegionalEndpoint = true

case "chatbot":
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions internal/service/globalaccelerator/service_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) (
cfg := *(config["aws_sdkv2_config"].(*aws.Config))

return globalaccelerator.NewFromConfig(cfg, func(o *globalaccelerator.Options) {
if config["partition"].(string) == names.StandardPartitionID {
// Global Accelerator endpoint is only available in AWS Commercial us-west-2 Region.
o.Region = names.USWest2RegionID
}

if endpoint := config[names.AttrEndpoint].(string); endpoint != "" {
tflog.Debug(ctx, "setting endpoint", map[string]any{
"tf_aws.endpoint": endpoint,
Expand All @@ -27,9 +32,6 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) (
tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting")
o.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateDisabled
}
} else if config["partition"].(string) == names.StandardPartitionID {
// Global Accelerator endpoint is only available in AWS Commercial us-west-2 Region.
o.Region = names.USWest2RegionID
}
}), nil
}
2 changes: 1 addition & 1 deletion names/data/names_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ frauddetector,frauddetector,frauddetector,frauddetector,,frauddetector,,,FraudDe
,,,,,,,,,,,,,,,,,FreeRTOS,,x,,,,,,,,,,No SDK support
fsx,fsx,fsx,fsx,,fsx,,,FSx,FSx,,1,,,aws_fsx_,,fsx_,FSx,Amazon,,,,,,,FSx,DescribeFileSystems,,,
gamelift,gamelift,gamelift,gamelift,,gamelift,,,GameLift,GameLift,,1,,,aws_gamelift_,,gamelift_,GameLift,Amazon,,,,,,,GameLift,ListGameServerGroups,,,
globalaccelerator,globalaccelerator,globalaccelerator,globalaccelerator,,globalaccelerator,,,GlobalAccelerator,GlobalAccelerator,x,,2,,aws_globalaccelerator_,,globalaccelerator_,Global Accelerator,AWS,,,,,,,Global Accelerator,ListAccelerators,,,
globalaccelerator,globalaccelerator,globalaccelerator,globalaccelerator,,globalaccelerator,,,GlobalAccelerator,GlobalAccelerator,x,,2,,aws_globalaccelerator_,,globalaccelerator_,Global Accelerator,AWS,,,,,,,Global Accelerator,ListAccelerators,,us-west-2,
glue,glue,glue,glue,,glue,,,Glue,Glue,,1,,,aws_glue_,,glue_,Glue,AWS,,,,,,,Glue,ListRegistries,,,
databrew,databrew,gluedatabrew,databrew,,databrew,,gluedatabrew,DataBrew,GlueDataBrew,,1,,,aws_databrew_,,databrew_,Glue DataBrew,AWS,,x,,,,,DataBrew,,,,
groundstation,groundstation,groundstation,groundstation,,groundstation,,,GroundStation,GroundStation,,,2,,aws_groundstation_,,groundstation_,Ground Station,AWS,,,,,,,GroundStation,ListConfigs,,,
Expand Down

0 comments on commit c6ac504

Please sign in to comment.