]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / aws / aws-sdk-go / aws / endpoints / decode.go
index 74f72de07356e6d1f686f0d85d1104a0ad486211..87b9ff3ffec2bb1e39ff42095e8ef2fb8603b354 100644 (file)
@@ -84,6 +84,8 @@ func decodeV3Endpoints(modelDef modelDefinition, opts DecodeModelOptions) (Resol
                custAddEC2Metadata(p)
                custAddS3DualStack(p)
                custRmIotDataService(p)
+               custFixAppAutoscalingChina(p)
+               custFixAppAutoscalingUsGov(p)
        }
 
        return ps, nil
@@ -94,7 +96,12 @@ func custAddS3DualStack(p *partition) {
                return
        }
 
-       s, ok := p.Services["s3"]
+       custAddDualstack(p, "s3")
+       custAddDualstack(p, "s3-control")
+}
+
+func custAddDualstack(p *partition, svcName string) {
+       s, ok := p.Services[svcName]
        if !ok {
                return
        }
@@ -102,7 +109,7 @@ func custAddS3DualStack(p *partition) {
        s.Defaults.HasDualStack = boxedTrue
        s.Defaults.DualStackHostname = "{service}.dualstack.{region}.{dnsSuffix}"
 
-       p.Services["s3"] = s
+       p.Services[svcName] = s
 }
 
 func custAddEC2Metadata(p *partition) {
@@ -122,6 +129,54 @@ func custRmIotDataService(p *partition) {
        delete(p.Services, "data.iot")
 }
 
+func custFixAppAutoscalingChina(p *partition) {
+       if p.ID != "aws-cn" {
+               return
+       }
+
+       const serviceName = "application-autoscaling"
+       s, ok := p.Services[serviceName]
+       if !ok {
+               return
+       }
+
+       const expectHostname = `autoscaling.{region}.amazonaws.com`
+       if e, a := s.Defaults.Hostname, expectHostname; e != a {
+               fmt.Printf("custFixAppAutoscalingChina: ignoring customization, expected %s, got %s\n", e, a)
+               return
+       }
+
+       s.Defaults.Hostname = expectHostname + ".cn"
+       p.Services[serviceName] = s
+}
+
+func custFixAppAutoscalingUsGov(p *partition) {
+       if p.ID != "aws-us-gov" {
+               return
+       }
+
+       const serviceName = "application-autoscaling"
+       s, ok := p.Services[serviceName]
+       if !ok {
+               return
+       }
+
+       if a := s.Defaults.CredentialScope.Service; a != "" {
+               fmt.Printf("custFixAppAutoscalingUsGov: ignoring customization, expected empty credential scope service, got %s\n", a)
+               return
+       }
+
+       if a := s.Defaults.Hostname; a != "" {
+               fmt.Printf("custFixAppAutoscalingUsGov: ignoring customization, expected empty hostname, got %s\n", a)
+               return
+       }
+
+       s.Defaults.CredentialScope.Service = "application-autoscaling"
+       s.Defaults.Hostname = "autoscaling.{region}.amazonaws.com"
+
+       p.Services[serviceName] = s
+}
+
 type decodeModelError struct {
        awsError
 }