deps: github.com/aws/aws-sdk-go@v1.16.4 and github.com/terraform-providers/terraform-provider-aws@v1.52.0

Notable changes:

* backend/s3: Automatic validation of `eu-north-1` region
* backend/s3: Support for `credential_process` handling in AWS configuration file

Updated via:

```
go get github.com/aws/aws-sdk-go@v1.16.4
go get github.com/terraform-providers/terraform-provider-aws@v1.52.0
go mod tidy
go mod vendor
```
This commit is contained in:
Brian Flad 2018-12-13 20:30:43 -05:00
parent ea1a1a3af5
commit 2979c42c68
No known key found for this signature in database
GPG Key ID: EC6252B42B012823
439 changed files with 119934 additions and 12255 deletions

7
go.mod
View File

@ -17,12 +17,13 @@ require (
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect
github.com/armon/go-radix v0.0.0-20160115234725-4239b77079c7 // indirect github.com/armon/go-radix v0.0.0-20160115234725-4239b77079c7 // indirect
github.com/aws/aws-sdk-go v1.15.55 github.com/aws/aws-sdk-go v1.16.4
github.com/beevik/etree v0.0.0-20171015221209-af219c0c7ea1 // indirect github.com/beevik/etree v0.0.0-20171015221209-af219c0c7ea1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.0.0-20161015143505-675b82c74c0e // indirect github.com/bgentry/speakeasy v0.0.0-20161015143505-675b82c74c0e // indirect
github.com/blang/semver v0.0.0-20170202183821-4a1e882c79dc github.com/blang/semver v0.0.0-20170202183821-4a1e882c79dc
github.com/boltdb/bolt v1.3.1 // indirect github.com/boltdb/bolt v1.3.1 // indirect
github.com/boombuler/barcode v1.0.0 // indirect
github.com/chzyer/logex v1.1.10 // indirect github.com/chzyer/logex v1.1.10 // indirect
github.com/chzyer/readline v0.0.0-20161106042343-c914be64f07d github.com/chzyer/readline v0.0.0-20161106042343-c914be64f07d
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
@ -78,7 +79,6 @@ require (
github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb // indirect github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb // indirect
github.com/hashicorp/vault v0.0.0-20161029210149-9a60bf2a50e4 github.com/hashicorp/vault v0.0.0-20161029210149-9a60bf2a50e4
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a // indirect github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a // indirect
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7 // indirect
github.com/jonboulle/clockwork v0.1.0 // indirect github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926 github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926
github.com/jtolds/gls v4.2.1+incompatible // indirect github.com/jtolds/gls v4.2.1+incompatible // indirect
@ -109,6 +109,7 @@ require (
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c // indirect github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c // indirect
github.com/pkg/errors v0.0.0-20170505043639-c605e284fe17 // indirect github.com/pkg/errors v0.0.0-20170505043639-c605e284fe17 // indirect
github.com/posener/complete v0.0.0-20171219111128-6bee943216c8 github.com/posener/complete v0.0.0-20171219111128-6bee943216c8
github.com/pquerna/otp v1.0.0 // indirect
github.com/satori/go.uuid v0.0.0-20160927100844-b061729afc07 // indirect github.com/satori/go.uuid v0.0.0-20160927100844-b061729afc07 // indirect
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/sirupsen/logrus v1.1.1 // indirect github.com/sirupsen/logrus v1.1.1 // indirect
@ -116,7 +117,7 @@ require (
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // indirect github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // indirect
github.com/soheilhy/cmux v0.1.4 // indirect github.com/soheilhy/cmux v0.1.4 // indirect
github.com/spf13/afero v1.0.2 github.com/spf13/afero v1.0.2
github.com/terraform-providers/terraform-provider-aws v1.41.0 github.com/terraform-providers/terraform-provider-aws v1.52.0
github.com/terraform-providers/terraform-provider-openstack v0.0.0-20170616075611-4080a521c6ea github.com/terraform-providers/terraform-provider-openstack v0.0.0-20170616075611-4080a521c6ea
github.com/terraform-providers/terraform-provider-template v1.0.0 // indirect github.com/terraform-providers/terraform-provider-template v1.0.0 // indirect
github.com/terraform-providers/terraform-provider-tls v1.2.0 // indirect github.com/terraform-providers/terraform-provider-tls v1.2.0 // indirect

31
go.sum
View File

@ -33,8 +33,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZ
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20160115234725-4239b77079c7 h1:MBXhrxjNkjdqJysfNbKMMPFNXlz6EzpOnPcsoYBeD3E= github.com/armon/go-radix v0.0.0-20160115234725-4239b77079c7 h1:MBXhrxjNkjdqJysfNbKMMPFNXlz6EzpOnPcsoYBeD3E=
github.com/armon/go-radix v0.0.0-20160115234725-4239b77079c7/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v0.0.0-20160115234725-4239b77079c7/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-sdk-go v1.15.55 h1:GHqCuxkZSNKWdubIADOCrZSeg42JxREPnXaoklBg2zg= github.com/aws/aws-sdk-go v1.16.4 h1:HQaquRQLvsZ8fRBbmFw6/+RJolhtjGMkkB0IhTM+hf8=
github.com/aws/aws-sdk-go v1.15.55/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.16.4/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/beevik/etree v0.0.0-20171015221209-af219c0c7ea1 h1:6fqkBkx5cRbd8Pq0UEMxyteIAPoE1KiPptnx1yEzJLU= github.com/beevik/etree v0.0.0-20171015221209-af219c0c7ea1 h1:6fqkBkx5cRbd8Pq0UEMxyteIAPoE1KiPptnx1yEzJLU=
github.com/beevik/etree v0.0.0-20171015221209-af219c0c7ea1/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/beevik/etree v0.0.0-20171015221209-af219c0c7ea1/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
@ -47,6 +47,8 @@ github.com/blang/semver v0.0.0-20170202183821-4a1e882c79dc h1:J/iAaGTCZYfT/allw6
github.com/blang/semver v0.0.0-20170202183821-4a1e882c79dc/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v0.0.0-20170202183821-4a1e882c79dc/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/boombuler/barcode v1.0.0 h1:s1TvRnXwL2xJRaccrdcBQMZxq6X7DvsMogtmJeHDdrc=
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k= github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k=
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
@ -66,8 +68,6 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbp
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v0.0.0-20160617170158-f0777076321a h1:pzKxqfSfp4kqrm6jfyVYYkWhf+e1hPRt3rX+Yj/3UBU=
github.com/dgrijalva/jwt-go v0.0.0-20160617170158-f0777076321a/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dimchansky/utfbom v1.0.0 h1:fGC2kkf4qOoKqZ4q7iIh+Vef4ubC1c38UDsEyZynZPc= github.com/dimchansky/utfbom v1.0.0 h1:fGC2kkf4qOoKqZ4q7iIh+Vef4ubC1c38UDsEyZynZPc=
@ -81,8 +81,6 @@ github.com/dylanmei/winrmtest v0.0.0-20170819153634-c2fbb09e6c08/go.mod h1:VBVDF
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-ini/ini v1.25.4 h1:Mujh4R/dH6YL8bxuISne3xX2+qcQ9p0IxKAP6ExWoUo=
github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg= github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg=
github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/gogo/protobuf v0.0.0-20180821102207-98f6aa8b3bcf h1:0nBDY6WfT0ChlHhvNcGw3BTjyDOtCom2yQTVBJv3MHg= github.com/gogo/protobuf v0.0.0-20180821102207-98f6aa8b3bcf h1:0nBDY6WfT0ChlHhvNcGw3BTjyDOtCom2yQTVBJv3MHg=
@ -91,8 +89,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekf
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 h1:u4bArs140e9+AfE52mFHOXVFnOSBJBRlzTHrOPLOIhE= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 h1:u4bArs140e9+AfE52mFHOXVFnOSBJBRlzTHrOPLOIhE=
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@ -123,8 +119,6 @@ github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1m
github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-azure-helpers v0.0.0-20181122151743-c51a3103be3b h1:AJjRaIeZiWlhYVf2skNYOjooaaIOcQzS94a3iSKnXKE=
github.com/hashicorp/go-azure-helpers v0.0.0-20181122151743-c51a3103be3b/go.mod h1:e+GPy2nvD+spqsdjUyw5tbo73rBbu955QBaV9GZoBEA=
github.com/hashicorp/go-azure-helpers v0.0.0-20181126135526-ec113df69f49 h1:jkGYE3AQEm95w4n8o/iR59duXnuSjMCf1MCNSwOJxAw= github.com/hashicorp/go-azure-helpers v0.0.0-20181126135526-ec113df69f49 h1:jkGYE3AQEm95w4n8o/iR59duXnuSjMCf1MCNSwOJxAw=
github.com/hashicorp/go-azure-helpers v0.0.0-20181126135526-ec113df69f49/go.mod h1:Y5ejHZY3jQby82dOASJzyQ2xZw37zs+D5x6AaOC6O5E= github.com/hashicorp/go-azure-helpers v0.0.0-20181126135526-ec113df69f49/go.mod h1:Y5ejHZY3jQby82dOASJzyQ2xZw37zs+D5x6AaOC6O5E=
github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de h1:XDCSythtg8aWSRSO29uwhgh7b127fWr+m5SemqjSUL8= github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de h1:XDCSythtg8aWSRSO29uwhgh7b127fWr+m5SemqjSUL8=
@ -143,8 +137,6 @@ github.com/hashicorp/go-msgpack v0.0.0-20150518234257-fa3f63826f7c/go.mod h1:ahL
github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-plugin v0.0.0-20181205205220-20341d70f4ff h1:z9Nk32P4kDgdYMZU4OGX1Nfpm2q9E++10TSQ6sltD/k=
github.com/hashicorp/go-plugin v0.0.0-20181205205220-20341d70f4ff/go.mod h1:Ft7ju2vWzhO0ETMKUVo12XmXmII6eSUS4rsPTkY/siA=
github.com/hashicorp/go-plugin v0.0.0-20181212150838-f444068e8f5a h1:z9eTtDWoxYrJvtAD+xAepmTEfEmYgouWUytJ84UWAr8= github.com/hashicorp/go-plugin v0.0.0-20181212150838-f444068e8f5a h1:z9eTtDWoxYrJvtAD+xAepmTEfEmYgouWUytJ84UWAr8=
github.com/hashicorp/go-plugin v0.0.0-20181212150838-f444068e8f5a/go.mod h1:Ft7ju2vWzhO0ETMKUVo12XmXmII6eSUS4rsPTkY/siA= github.com/hashicorp/go-plugin v0.0.0-20181212150838-f444068e8f5a/go.mod h1:Ft7ju2vWzhO0ETMKUVo12XmXmII6eSUS4rsPTkY/siA=
github.com/hashicorp/go-retryablehttp v0.5.0 h1:aVN0FYnPwAgZI/hVzqwfMiM86ttcHTlQKbBVeVmXPIs= github.com/hashicorp/go-retryablehttp v0.5.0 h1:aVN0FYnPwAgZI/hVzqwfMiM86ttcHTlQKbBVeVmXPIs=
@ -167,8 +159,6 @@ github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCO
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws=
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hashicorp/hcl2 v0.0.0-20181206005933-df9794be1f23 h1:RcXTRSKSKCJYXxI7yaOwAH1lYfZIzxhQhW2bFC8hABE=
github.com/hashicorp/hcl2 v0.0.0-20181206005933-df9794be1f23/go.mod h1:ShfpTh661oAaxo7VcNxg0zcZW6jvMa7Moy2oFx7e5dE=
github.com/hashicorp/hcl2 v0.0.0-20181208003705-670926858200 h1:F/nGtDwtQsuw7ZHmiLpHsPWNljDC24kiSHSGUnou9sw= github.com/hashicorp/hcl2 v0.0.0-20181208003705-670926858200 h1:F/nGtDwtQsuw7ZHmiLpHsPWNljDC24kiSHSGUnou9sw=
github.com/hashicorp/hcl2 v0.0.0-20181208003705-670926858200/go.mod h1:ShfpTh661oAaxo7VcNxg0zcZW6jvMa7Moy2oFx7e5dE= github.com/hashicorp/hcl2 v0.0.0-20181208003705-670926858200/go.mod h1:ShfpTh661oAaxo7VcNxg0zcZW6jvMa7Moy2oFx7e5dE=
github.com/hashicorp/hil v0.0.0-20170627220502-fa9f258a9250 h1:fooK5IvDL/KIsi4LxF/JH68nVdrBSiGNPhS2JAQjtjo= github.com/hashicorp/hil v0.0.0-20170627220502-fa9f258a9250 h1:fooK5IvDL/KIsi4LxF/JH68nVdrBSiGNPhS2JAQjtjo=
@ -187,9 +177,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a h1:FyS/ubzBR5xJlnJGRTwe7GUHpJOR4ukYK3y+LFNffuA= github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a h1:FyS/ubzBR5xJlnJGRTwe7GUHpJOR4ukYK3y+LFNffuA=
github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a/go.mod h1:uoIMjNxUfXi48Ci40IXkPRbghZ1vbti6v9LCbNqRgHY= github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a/go.mod h1:uoIMjNxUfXi48Ci40IXkPRbghZ1vbti6v9LCbNqRgHY=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7 h1:SMvOWPJCES2GdFracYbBQh93GXac8fq7HeN6JnpduB8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926 h1:kie3qOosvRKqwij2HGzXWffwpXvcqfPPXRUw8I4F/mg= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926 h1:kie3qOosvRKqwij2HGzXWffwpXvcqfPPXRUw8I4F/mg=
@ -235,8 +224,6 @@ github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286 h1:KHyL+3mQO
github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
github.com/mitchellh/copystructure v0.0.0-20170525013902-d23ffcb85de3 h1:dECZqiJYhKdj9QlLpiQaRDXHDXRTdiyZI3owdDGhlYY= github.com/mitchellh/copystructure v0.0.0-20170525013902-d23ffcb85de3 h1:dECZqiJYhKdj9QlLpiQaRDXHDXRTdiyZI3owdDGhlYY=
github.com/mitchellh/copystructure v0.0.0-20170525013902-d23ffcb85de3/go.mod h1:eOsF2yLPlBBJPvD+nhl5QMTBSOBbOph6N7j/IDUw7PY= github.com/mitchellh/copystructure v0.0.0-20170525013902-d23ffcb85de3/go.mod h1:eOsF2yLPlBBJPvD+nhl5QMTBSOBbOph6N7j/IDUw7PY=
github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747 h1:eQox4Rh4ewJF+mqYPxCkmBAirRnPaHEB26UkNuPyjlk=
github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-linereader v0.0.0-20141013185533-07bab5fdd958 h1:wN+5lV34eSnVSZgBLWRGHr6L4giR3/wI2B9DLmVnlfI= github.com/mitchellh/go-linereader v0.0.0-20141013185533-07bab5fdd958 h1:wN+5lV34eSnVSZgBLWRGHr6L4giR3/wI2B9DLmVnlfI=
@ -275,6 +262,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v0.0.0-20171219111128-6bee943216c8 h1:lcb1zvdlaZyEbl2OXifN3uOYYyIvllofUbmp9bwbL+0= github.com/posener/complete v0.0.0-20171219111128-6bee943216c8 h1:lcb1zvdlaZyEbl2OXifN3uOYYyIvllofUbmp9bwbL+0=
github.com/posener/complete v0.0.0-20171219111128-6bee943216c8/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v0.0.0-20171219111128-6bee943216c8/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/pquerna/otp v1.0.0 h1:TBZrpfnzVbgmpYhiYBK+bJ4Ig0+ye+GGNMe2pTrvxCo=
github.com/pquerna/otp v1.0.0/go.mod h1:Zad1CMQfSQZI5KLpahDiSUX4tMMREnXw98IvL1nhgMk=
github.com/prometheus/client_golang v0.8.0 h1:1921Yw9Gc3iSc4VQh3PIoOqgPCZS7G/4xQNVUp8Mda8= github.com/prometheus/client_golang v0.8.0 h1:1921Yw9Gc3iSc4VQh3PIoOqgPCZS7G/4xQNVUp8Mda8=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
@ -304,8 +293,8 @@ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d h1:Z4EH+5EffvBEhh37F0C0DnpklTMh00JOkjW5zK3ofBI= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d h1:Z4EH+5EffvBEhh37F0C0DnpklTMh00JOkjW5zK3ofBI=
github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw=
github.com/terraform-providers/terraform-provider-aws v1.41.0 h1:ZOuxMXREOtJ+SHMX5SnbZbiqYhl9GNfZDl4f0H6CaOM= github.com/terraform-providers/terraform-provider-aws v1.52.0 h1:hfFaKOUtL/ud9Y4PFgFT7F8Ss61lMIK1P+ndPEhPA7s=
github.com/terraform-providers/terraform-provider-aws v1.41.0/go.mod h1:uvqaeKnm2ydZ2LuKuW1NDNBu6heC/7IDGXWm36/6oKs= github.com/terraform-providers/terraform-provider-aws v1.52.0/go.mod h1:uvqaeKnm2ydZ2LuKuW1NDNBu6heC/7IDGXWm36/6oKs=
github.com/terraform-providers/terraform-provider-openstack v0.0.0-20170616075611-4080a521c6ea h1:IfuzHOI3XwwYZS2Xw8SQbxOtGXlIUrKtXtuDCTNxmsQ= github.com/terraform-providers/terraform-provider-openstack v0.0.0-20170616075611-4080a521c6ea h1:IfuzHOI3XwwYZS2Xw8SQbxOtGXlIUrKtXtuDCTNxmsQ=
github.com/terraform-providers/terraform-provider-openstack v0.0.0-20170616075611-4080a521c6ea/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= github.com/terraform-providers/terraform-provider-openstack v0.0.0-20170616075611-4080a521c6ea/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew=
github.com/terraform-providers/terraform-provider-template v1.0.0 h1:g2pyFaAJu369iAb7qGWmVwtQ15/35lRAfW91Je8wLjE= github.com/terraform-providers/terraform-provider-template v1.0.0 h1:g2pyFaAJu369iAb7qGWmVwtQ15/35lRAfW91Je8wLjE=

View File

@ -23,28 +23,27 @@ func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) {
case reflect.Struct: case reflect.Struct:
buf.WriteString("{\n") buf.WriteString("{\n")
names := []string{}
for i := 0; i < v.Type().NumField(); i++ { for i := 0; i < v.Type().NumField(); i++ {
name := v.Type().Field(i).Name ft := v.Type().Field(i)
f := v.Field(i) fv := v.Field(i)
if name[0:1] == strings.ToLower(name[0:1]) {
if ft.Name[0:1] == strings.ToLower(ft.Name[0:1]) {
continue // ignore unexported fields continue // ignore unexported fields
} }
if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice) && f.IsNil() { if (fv.Kind() == reflect.Ptr || fv.Kind() == reflect.Slice) && fv.IsNil() {
continue // ignore unset fields continue // ignore unset fields
} }
names = append(names, name)
}
for i, n := range names {
val := v.FieldByName(n)
buf.WriteString(strings.Repeat(" ", indent+2)) buf.WriteString(strings.Repeat(" ", indent+2))
buf.WriteString(n + ": ") buf.WriteString(ft.Name + ": ")
stringValue(val, indent+2, buf)
if i < len(names)-1 { if tag := ft.Tag.Get("sensitive"); tag == "true" {
buf.WriteString(",\n") buf.WriteString("<sensitive>")
} else {
stringValue(fv, indent+2, buf)
} }
buf.WriteString(",\n")
} }
buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") buf.WriteString("\n" + strings.Repeat(" ", indent) + "}")

View File

@ -45,8 +45,8 @@ type Config struct {
// that overrides the default generated endpoint for a client. Set this // that overrides the default generated endpoint for a client. Set this
// to `""` to use the default generated endpoint. // to `""` to use the default generated endpoint.
// //
// @note You must still provide a `Region` value when specifying an // Note: You must still provide a `Region` value when specifying an
// endpoint for a client. // endpoint for a client.
Endpoint *string Endpoint *string
// The resolver to use for looking up endpoints for AWS service clients // The resolver to use for looking up endpoints for AWS service clients
@ -65,8 +65,8 @@ type Config struct {
// noted. A full list of regions is found in the "Regions and Endpoints" // noted. A full list of regions is found in the "Regions and Endpoints"
// document. // document.
// //
// @see http://docs.aws.amazon.com/general/latest/gr/rande.html // See http://docs.aws.amazon.com/general/latest/gr/rande.html for AWS
// AWS Regions and Endpoints // Regions and Endpoints.
Region *string Region *string
// Set this to `true` to disable SSL when sending requests. Defaults // Set this to `true` to disable SSL when sending requests. Defaults
@ -120,9 +120,10 @@ type Config struct {
// will use virtual hosted bucket addressing when possible // will use virtual hosted bucket addressing when possible
// (`http://BUCKET.s3.amazonaws.com/KEY`). // (`http://BUCKET.s3.amazonaws.com/KEY`).
// //
// @note This configuration option is specific to the Amazon S3 service. // Note: This configuration option is specific to the Amazon S3 service.
// @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html //
// Amazon S3: Virtual Hosting of Buckets // See http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
// for Amazon S3: Virtual Hosting of Buckets
S3ForcePathStyle *bool S3ForcePathStyle *bool
// Set this to `true` to disable the SDK adding the `Expect: 100-Continue` // Set this to `true` to disable the SDK adding the `Expect: 100-Continue`
@ -223,6 +224,28 @@ type Config struct {
// Key: aws.String("//foo//bar//moo"), // Key: aws.String("//foo//bar//moo"),
// }) // })
DisableRestProtocolURICleaning *bool DisableRestProtocolURICleaning *bool
// EnableEndpointDiscovery will allow for endpoint discovery on operations that
// have the definition in its model. By default, endpoint discovery is off.
//
// Example:
// sess := session.Must(session.NewSession(&aws.Config{
// EnableEndpointDiscovery: aws.Bool(true),
// }))
//
// svc := s3.New(sess)
// out, err := svc.GetObject(&s3.GetObjectInput {
// Bucket: aws.String("bucketname"),
// Key: aws.String("/foo/bar/moo"),
// })
EnableEndpointDiscovery *bool
// DisableEndpointHostPrefix will disable the SDK's behavior of prefixing
// request endpoint hosts with modeled information.
//
// Disabling this feature is useful when you want to use local endpoints
// for testing that do not support the modeled host prefix pattern.
DisableEndpointHostPrefix *bool
} }
// NewConfig returns a new Config pointer that can be chained with builder // NewConfig returns a new Config pointer that can be chained with builder
@ -377,6 +400,19 @@ func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config {
return c return c
} }
// WithEndpointDiscovery will set whether or not to use endpoint discovery.
func (c *Config) WithEndpointDiscovery(t bool) *Config {
c.EnableEndpointDiscovery = &t
return c
}
// WithDisableEndpointHostPrefix will set whether or not to use modeled host prefix
// when making requests.
func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config {
c.DisableEndpointHostPrefix = &t
return c
}
// MergeIn merges the passed in configs into the existing config object. // MergeIn merges the passed in configs into the existing config object.
func (c *Config) MergeIn(cfgs ...*Config) { func (c *Config) MergeIn(cfgs ...*Config) {
for _, other := range cfgs { for _, other := range cfgs {
@ -476,6 +512,14 @@ func mergeInConfig(dst *Config, other *Config) {
if other.EnforceShouldRetryCheck != nil { if other.EnforceShouldRetryCheck != nil {
dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck
} }
if other.EnableEndpointDiscovery != nil {
dst.EnableEndpointDiscovery = other.EnableEndpointDiscovery
}
if other.DisableEndpointHostPrefix != nil {
dst.DisableEndpointHostPrefix = other.DisableEndpointHostPrefix
}
} }
// Copy will return a shallow copy of the Config object. If any additional // Copy will return a shallow copy of the Config object. If any additional

View File

@ -72,9 +72,9 @@ var ValidateReqSigHandler = request.NamedHandler{
signedTime = r.LastSignedAt signedTime = r.LastSignedAt
} }
// 10 minutes to allow for some clock skew/delays in transmission. // 5 minutes to allow for some clock skew/delays in transmission.
// Would be improved with aws/aws-sdk-go#423 // Would be improved with aws/aws-sdk-go#423
if signedTime.Add(10 * time.Minute).After(time.Now()) { if signedTime.Add(5 * time.Minute).After(time.Now()) {
return return
} }

View File

@ -9,9 +9,7 @@ var (
// providers in the ChainProvider. // providers in the ChainProvider.
// //
// This has been deprecated. For verbose error messaging set // This has been deprecated. For verbose error messaging set
// aws.Config.CredentialsChainVerboseErrors to true // aws.Config.CredentialsChainVerboseErrors to true.
//
// @readonly
ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders", ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders",
`no valid providers in chain. Deprecated. `no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors`, For verbose messaging see aws.Config.CredentialsChainVerboseErrors`,

View File

@ -64,8 +64,6 @@ import (
// Credentials: credentials.AnonymousCredentials, // Credentials: credentials.AnonymousCredentials,
// }))) // })))
// // Access public S3 buckets. // // Access public S3 buckets.
//
// @readonly
var AnonymousCredentials = NewStaticCredentials("", "", "") var AnonymousCredentials = NewStaticCredentials("", "", "")
// A Value is the AWS credentials value for individual credential fields. // A Value is the AWS credentials value for individual credential fields.

View File

@ -12,14 +12,10 @@ const EnvProviderName = "EnvProvider"
var ( var (
// ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be // ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be
// found in the process's environment. // found in the process's environment.
//
// @readonly
ErrAccessKeyIDNotFound = awserr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil) ErrAccessKeyIDNotFound = awserr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil)
// ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key // ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key
// can't be found in the process's environment. // can't be found in the process's environment.
//
// @readonly
ErrSecretAccessKeyNotFound = awserr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil) ErrSecretAccessKeyNotFound = awserr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil)
) )

View File

@ -0,0 +1,425 @@
/*
Package processcreds is a credential Provider to retrieve `credential_process`
credentials.
WARNING: The following describes a method of sourcing credentials from an external
process. This can potentially be dangerous, so proceed with caution. Other
credential providers should be preferred if at all possible. If using this
option, you should make sure that the config file is as locked down as possible
using security best practices for your operating system.
You can use credentials from a `credential_process` in a variety of ways.
One way is to setup your shared config file, located in the default
location, with the `credential_process` key and the command you want to be
called. You also need to set the AWS_SDK_LOAD_CONFIG environment variable
(e.g., `export AWS_SDK_LOAD_CONFIG=1`) to use the shared config file.
[default]
credential_process = /command/to/call
Creating a new session will use the credential process to retrieve credentials.
NOTE: If there are credentials in the profile you are using, the credential
process will not be used.
// Initialize a session to load credentials.
sess, _ := session.NewSession(&aws.Config{
Region: aws.String("us-east-1")},
)
// Create S3 service client to use the credentials.
svc := s3.New(sess)
Another way to use the `credential_process` method is by using
`credentials.NewCredentials()` and providing a command to be executed to
retrieve credentials:
// Create credentials using the ProcessProvider.
creds := processcreds.NewCredentials("/path/to/command")
// Create service client value configured for credentials.
svc := s3.New(sess, &aws.Config{Credentials: creds})
You can set a non-default timeout for the `credential_process` with another
constructor, `credentials.NewCredentialsTimeout()`, providing the timeout. To
set a one minute timeout:
// Create credentials using the ProcessProvider.
creds := processcreds.NewCredentialsTimeout(
"/path/to/command",
time.Duration(500) * time.Millisecond)
If you need more control, you can set any configurable options in the
credentials using one or more option functions. For example, you can set a two
minute timeout, a credential duration of 60 minutes, and a maximum stdout
buffer size of 2k.
creds := processcreds.NewCredentials(
"/path/to/command",
func(opt *ProcessProvider) {
opt.Timeout = time.Duration(2) * time.Minute
opt.Duration = time.Duration(60) * time.Minute
opt.MaxBufSize = 2048
})
You can also use your own `exec.Cmd`:
// Create an exec.Cmd
myCommand := exec.Command("/path/to/command")
// Create credentials using your exec.Cmd and custom timeout
creds := processcreds.NewCredentialsCommand(
myCommand,
func(opt *processcreds.ProcessProvider) {
opt.Timeout = time.Duration(1) * time.Second
})
*/
package processcreds
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"runtime"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials"
)
const (
// ProviderName is the name this credentials provider will label any
// returned credentials Value with.
ProviderName = `ProcessProvider`
// ErrCodeProcessProviderParse error parsing process output
ErrCodeProcessProviderParse = "ProcessProviderParseError"
// ErrCodeProcessProviderVersion version error in output
ErrCodeProcessProviderVersion = "ProcessProviderVersionError"
// ErrCodeProcessProviderRequired required attribute missing in output
ErrCodeProcessProviderRequired = "ProcessProviderRequiredError"
// ErrCodeProcessProviderExecution execution of command failed
ErrCodeProcessProviderExecution = "ProcessProviderExecutionError"
// errMsgProcessProviderTimeout process took longer than allowed
errMsgProcessProviderTimeout = "credential process timed out"
// errMsgProcessProviderProcess process error
errMsgProcessProviderProcess = "error in credential_process"
// errMsgProcessProviderParse problem parsing output
errMsgProcessProviderParse = "parse failed of credential_process output"
// errMsgProcessProviderVersion version error in output
errMsgProcessProviderVersion = "wrong version in process output (not 1)"
// errMsgProcessProviderMissKey missing access key id in output
errMsgProcessProviderMissKey = "missing AccessKeyId in process output"
// errMsgProcessProviderMissSecret missing secret acess key in output
errMsgProcessProviderMissSecret = "missing SecretAccessKey in process output"
// errMsgProcessProviderPrepareCmd prepare of command failed
errMsgProcessProviderPrepareCmd = "failed to prepare command"
// errMsgProcessProviderEmptyCmd command must not be empty
errMsgProcessProviderEmptyCmd = "command must not be empty"
// errMsgProcessProviderPipe failed to initialize pipe
errMsgProcessProviderPipe = "failed to initialize pipe"
// DefaultDuration is the default amount of time in minutes that the
// credentials will be valid for.
DefaultDuration = time.Duration(15) * time.Minute
// DefaultBufSize limits buffer size from growing to an enormous
// amount due to a faulty process.
DefaultBufSize = 1024
// DefaultTimeout default limit on time a process can run.
DefaultTimeout = time.Duration(1) * time.Minute
)
// ProcessProvider satisfies the credentials.Provider interface, and is a
// client to retrieve credentials from a process.
type ProcessProvider struct {
staticCreds bool
credentials.Expiry
originalCommand []string
// Expiry duration of the credentials. Defaults to 15 minutes if not set.
Duration time.Duration
// ExpiryWindow will allow the credentials to trigger refreshing prior to
// the credentials actually expiring. This is beneficial so race conditions
// with expiring credentials do not cause request to fail unexpectedly
// due to ExpiredTokenException exceptions.
//
// So a ExpiryWindow of 10s would cause calls to IsExpired() to return true
// 10 seconds before the credentials are actually expired.
//
// If ExpiryWindow is 0 or less it will be ignored.
ExpiryWindow time.Duration
// A string representing an os command that should return a JSON with
// credential information.
command *exec.Cmd
// MaxBufSize limits memory usage from growing to an enormous
// amount due to a faulty process.
MaxBufSize int
// Timeout limits the time a process can run.
Timeout time.Duration
}
// NewCredentials returns a pointer to a new Credentials object wrapping the
// ProcessProvider. The credentials will expire every 15 minutes by default.
func NewCredentials(command string, options ...func(*ProcessProvider)) *credentials.Credentials {
p := &ProcessProvider{
command: exec.Command(command),
Duration: DefaultDuration,
Timeout: DefaultTimeout,
MaxBufSize: DefaultBufSize,
}
for _, option := range options {
option(p)
}
return credentials.NewCredentials(p)
}
// NewCredentialsTimeout returns a pointer to a new Credentials object with
// the specified command and timeout, and default duration and max buffer size.
func NewCredentialsTimeout(command string, timeout time.Duration) *credentials.Credentials {
p := NewCredentials(command, func(opt *ProcessProvider) {
opt.Timeout = timeout
})
return p
}
// NewCredentialsCommand returns a pointer to a new Credentials object with
// the specified command, and default timeout, duration and max buffer size.
func NewCredentialsCommand(command *exec.Cmd, options ...func(*ProcessProvider)) *credentials.Credentials {
p := &ProcessProvider{
command: command,
Duration: DefaultDuration,
Timeout: DefaultTimeout,
MaxBufSize: DefaultBufSize,
}
for _, option := range options {
option(p)
}
return credentials.NewCredentials(p)
}
type credentialProcessResponse struct {
Version int
AccessKeyID string `json:"AccessKeyId"`
SecretAccessKey string
SessionToken string
Expiration *time.Time
}
// Retrieve executes the 'credential_process' and returns the credentials.
func (p *ProcessProvider) Retrieve() (credentials.Value, error) {
out, err := p.executeCredentialProcess()
if err != nil {
return credentials.Value{ProviderName: ProviderName}, err
}
// Serialize and validate response
resp := &credentialProcessResponse{}
if err = json.Unmarshal(out, resp); err != nil {
return credentials.Value{ProviderName: ProviderName}, awserr.New(
ErrCodeProcessProviderParse,
fmt.Sprintf("%s: %s", errMsgProcessProviderParse, string(out)),
err)
}
if resp.Version != 1 {
return credentials.Value{ProviderName: ProviderName}, awserr.New(
ErrCodeProcessProviderVersion,
errMsgProcessProviderVersion,
nil)
}
if len(resp.AccessKeyID) == 0 {
return credentials.Value{ProviderName: ProviderName}, awserr.New(
ErrCodeProcessProviderRequired,
errMsgProcessProviderMissKey,
nil)
}
if len(resp.SecretAccessKey) == 0 {
return credentials.Value{ProviderName: ProviderName}, awserr.New(
ErrCodeProcessProviderRequired,
errMsgProcessProviderMissSecret,
nil)
}
// Handle expiration
p.staticCreds = resp.Expiration == nil
if resp.Expiration != nil {
p.SetExpiration(*resp.Expiration, p.ExpiryWindow)
}
return credentials.Value{
ProviderName: ProviderName,
AccessKeyID: resp.AccessKeyID,
SecretAccessKey: resp.SecretAccessKey,
SessionToken: resp.SessionToken,
}, nil
}
// IsExpired returns true if the credentials retrieved are expired, or not yet
// retrieved.
func (p *ProcessProvider) IsExpired() bool {
if p.staticCreds {
return false
}
return p.Expiry.IsExpired()
}
// prepareCommand prepares the command to be executed.
func (p *ProcessProvider) prepareCommand() error {
var cmdArgs []string
if runtime.GOOS == "windows" {
cmdArgs = []string{"cmd.exe", "/C"}
} else {
cmdArgs = []string{"sh", "-c"}
}
if len(p.originalCommand) == 0 {
p.originalCommand = make([]string, len(p.command.Args))
copy(p.originalCommand, p.command.Args)
// check for empty command because it succeeds
if len(strings.TrimSpace(p.originalCommand[0])) < 1 {
return awserr.New(
ErrCodeProcessProviderExecution,
fmt.Sprintf(
"%s: %s",
errMsgProcessProviderPrepareCmd,
errMsgProcessProviderEmptyCmd),
nil)
}
}
cmdArgs = append(cmdArgs, p.originalCommand...)
p.command = exec.Command(cmdArgs[0], cmdArgs[1:]...)
p.command.Env = os.Environ()
return nil
}
// executeCredentialProcess starts the credential process on the OS and
// returns the results or an error.
func (p *ProcessProvider) executeCredentialProcess() ([]byte, error) {
if err := p.prepareCommand(); err != nil {
return nil, err
}
// Setup the pipes
outReadPipe, outWritePipe, err := os.Pipe()
if err != nil {
return nil, awserr.New(
ErrCodeProcessProviderExecution,
errMsgProcessProviderPipe,
err)
}
p.command.Stderr = os.Stderr // display stderr on console for MFA
p.command.Stdout = outWritePipe // get creds json on process's stdout
p.command.Stdin = os.Stdin // enable stdin for MFA
output := bytes.NewBuffer(make([]byte, 0, p.MaxBufSize))
stdoutCh := make(chan error, 1)
go readInput(
io.LimitReader(outReadPipe, int64(p.MaxBufSize)),
output,
stdoutCh)
execCh := make(chan error, 1)
go executeCommand(*p.command, execCh)
finished := false
var errors []error
for !finished {
select {
case readError := <-stdoutCh:
errors = appendError(errors, readError)
finished = true
case execError := <-execCh:
err := outWritePipe.Close()
errors = appendError(errors, err)
errors = appendError(errors, execError)
if errors != nil {
return output.Bytes(), awserr.NewBatchError(
ErrCodeProcessProviderExecution,
errMsgProcessProviderProcess,
errors)
}
case <-time.After(p.Timeout):
finished = true
return output.Bytes(), awserr.NewBatchError(
ErrCodeProcessProviderExecution,
errMsgProcessProviderTimeout,
errors) // errors can be nil
}
}
out := output.Bytes()
if runtime.GOOS == "windows" {
// windows adds slashes to quotes
out = []byte(strings.Replace(string(out), `\"`, `"`, -1))
}
return out, nil
}
// appendError conveniently checks for nil before appending slice
func appendError(errors []error, err error) []error {
if err != nil {
return append(errors, err)
}
return errors
}
func executeCommand(cmd exec.Cmd, exec chan error) {
// Start the command
err := cmd.Start()
if err == nil {
err = cmd.Wait()
}
exec <- err
}
func readInput(r io.Reader, w io.Writer, read chan error) {
tee := io.TeeReader(r, w)
_, err := ioutil.ReadAll(tee)
if err == io.EOF {
err = nil
}
read <- err // will only arrive here when write end of pipe is closed
}

View File

@ -4,9 +4,8 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/go-ini/ini"
"github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/internal/ini"
"github.com/aws/aws-sdk-go/internal/shareddefaults" "github.com/aws/aws-sdk-go/internal/shareddefaults"
) )
@ -77,36 +76,37 @@ func (p *SharedCredentialsProvider) IsExpired() bool {
// The credentials retrieved from the profile will be returned or error. Error will be // The credentials retrieved from the profile will be returned or error. Error will be
// returned if it fails to read from the file, or the data is invalid. // returned if it fails to read from the file, or the data is invalid.
func loadProfile(filename, profile string) (Value, error) { func loadProfile(filename, profile string) (Value, error) {
config, err := ini.Load(filename) config, err := ini.OpenFile(filename)
if err != nil { if err != nil {
return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err) return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err)
} }
iniProfile, err := config.GetSection(profile)
if err != nil { iniProfile, ok := config.GetSection(profile)
return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to get profile", err) if !ok {
return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to get profile", nil)
} }
id, err := iniProfile.GetKey("aws_access_key_id") id := iniProfile.String("aws_access_key_id")
if err != nil { if len(id) == 0 {
return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsAccessKey", return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsAccessKey",
fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename), fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename),
err) nil)
} }
secret, err := iniProfile.GetKey("aws_secret_access_key") secret := iniProfile.String("aws_secret_access_key")
if err != nil { if len(secret) == 0 {
return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsSecret", return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsSecret",
fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename), fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename),
nil) nil)
} }
// Default to empty string if not found // Default to empty string if not found
token := iniProfile.Key("aws_session_token") token := iniProfile.String("aws_session_token")
return Value{ return Value{
AccessKeyID: id.String(), AccessKeyID: id,
SecretAccessKey: secret.String(), SecretAccessKey: secret,
SessionToken: token.String(), SessionToken: token,
ProviderName: SharedCredsProviderName, ProviderName: SharedCredsProviderName,
}, nil }, nil
} }

View File

@ -9,8 +9,6 @@ const StaticProviderName = "StaticProvider"
var ( var (
// ErrStaticCredentialsEmpty is emitted when static credentials are empty. // ErrStaticCredentialsEmpty is emitted when static credentials are empty.
//
// @readonly
ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil) ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil)
) )

119
vendor/github.com/aws/aws-sdk-go/aws/crr/cache.go generated vendored Normal file
View File

@ -0,0 +1,119 @@
package crr
import (
"sync/atomic"
)
// EndpointCache is an LRU cache that holds a series of endpoints
// based on some key. The datastructure makes use of a read write
// mutex to enable asynchronous use.
type EndpointCache struct {
endpoints syncMap
endpointLimit int64
// size is used to count the number elements in the cache.
// The atomic package is used to ensure this size is accurate when
// using multiple goroutines.
size int64
}
// NewEndpointCache will return a newly initialized cache with a limit
// of endpointLimit entries.
func NewEndpointCache(endpointLimit int64) *EndpointCache {
return &EndpointCache{
endpointLimit: endpointLimit,
endpoints: newSyncMap(),
}
}
// get is a concurrent safe get operation that will retrieve an endpoint
// based on endpointKey. A boolean will also be returned to illustrate whether
// or not the endpoint had been found.
func (c *EndpointCache) get(endpointKey string) (Endpoint, bool) {
endpoint, ok := c.endpoints.Load(endpointKey)
if !ok {
return Endpoint{}, false
}
c.endpoints.Store(endpointKey, endpoint)
return endpoint.(Endpoint), true
}
// Has returns if the enpoint cache contains a valid entry for the endpoint key
// provided.
func (c *EndpointCache) Has(endpointKey string) bool {
endpoint, ok := c.get(endpointKey)
_, found := endpoint.GetValidAddress()
return ok && found
}
// Get will retrieve a weighted address based off of the endpoint key. If an endpoint
// should be retrieved, due to not existing or the current endpoint has expired
// the Discoverer object that was passed in will attempt to discover a new endpoint
// and add that to the cache.
func (c *EndpointCache) Get(d Discoverer, endpointKey string, required bool) (WeightedAddress, error) {
var err error
endpoint, ok := c.get(endpointKey)
weighted, found := endpoint.GetValidAddress()
shouldGet := !ok || !found
if required && shouldGet {
if endpoint, err = c.discover(d, endpointKey); err != nil {
return WeightedAddress{}, err
}
weighted, _ = endpoint.GetValidAddress()
} else if shouldGet {
go c.discover(d, endpointKey)
}
return weighted, nil
}
// Add is a concurrent safe operation that will allow new endpoints to be added
// to the cache. If the cache is full, the number of endpoints equal endpointLimit,
// then this will remove the oldest entry before adding the new endpoint.
func (c *EndpointCache) Add(endpoint Endpoint) {
// de-dups multiple adds of an endpoint with a pre-existing key
if iface, ok := c.endpoints.Load(endpoint.Key); ok {
e := iface.(Endpoint)
if e.Len() > 0 {
return
}
}
c.endpoints.Store(endpoint.Key, endpoint)
size := atomic.AddInt64(&c.size, 1)
if size > 0 && size > c.endpointLimit {
c.deleteRandomKey()
}
}
// deleteRandomKey will delete a random key from the cache. If
// no key was deleted false will be returned.
func (c *EndpointCache) deleteRandomKey() bool {
atomic.AddInt64(&c.size, -1)
found := false
c.endpoints.Range(func(key, value interface{}) bool {
found = true
c.endpoints.Delete(key)
return false
})
return found
}
// discover will get and store and endpoint using the Discoverer.
func (c *EndpointCache) discover(d Discoverer, endpointKey string) (Endpoint, error) {
endpoint, err := d.Discover()
if err != nil {
return Endpoint{}, err
}
endpoint.Key = endpointKey
c.Add(endpoint)
return endpoint, nil
}

99
vendor/github.com/aws/aws-sdk-go/aws/crr/endpoint.go generated vendored Normal file
View File

@ -0,0 +1,99 @@
package crr
import (
"net/url"
"sort"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
)
// Endpoint represents an endpoint used in endpoint discovery.
type Endpoint struct {
Key string
Addresses WeightedAddresses
}
// WeightedAddresses represents a list of WeightedAddress.
type WeightedAddresses []WeightedAddress
// WeightedAddress represents an address with a given weight.
type WeightedAddress struct {
URL *url.URL
Expired time.Time
}
// HasExpired will return whether or not the endpoint has expired with
// the exception of a zero expiry meaning does not expire.
func (e WeightedAddress) HasExpired() bool {
return e.Expired.Before(time.Now())
}
// Add will add a given WeightedAddress to the address list of Endpoint.
func (e *Endpoint) Add(addr WeightedAddress) {
e.Addresses = append(e.Addresses, addr)
}
// Len returns the number of valid endpoints where valid means the endpoint
// has not expired.
func (e *Endpoint) Len() int {
validEndpoints := 0
for _, endpoint := range e.Addresses {
if endpoint.HasExpired() {
continue
}
validEndpoints++
}
return validEndpoints
}
// GetValidAddress will return a non-expired weight endpoint
func (e *Endpoint) GetValidAddress() (WeightedAddress, bool) {
for i := 0; i < len(e.Addresses); i++ {
we := e.Addresses[i]
if we.HasExpired() {
e.Addresses = append(e.Addresses[:i], e.Addresses[i+1:]...)
i--
continue
}
return we, true
}
return WeightedAddress{}, false
}
// Discoverer is an interface used to discovery which endpoint hit. This
// allows for specifics about what parameters need to be used to be contained
// in the Discoverer implementor.
type Discoverer interface {
Discover() (Endpoint, error)
}
// BuildEndpointKey will sort the keys in alphabetical order and then retrieve
// the values in that order. Those values are then concatenated together to form
// the endpoint key.
func BuildEndpointKey(params map[string]*string) string {
keys := make([]string, len(params))
i := 0
for k := range params {
keys[i] = k
i++
}
sort.Strings(keys)
values := make([]string, len(params))
for i, k := range keys {
if params[k] == nil {
continue
}
values[i] = aws.StringValue(params[k])
}
return strings.Join(values, ".")
}

29
vendor/github.com/aws/aws-sdk-go/aws/crr/sync_map.go generated vendored Normal file
View File

@ -0,0 +1,29 @@
// +build go1.9
package crr
import (
"sync"
)
type syncMap sync.Map
func newSyncMap() syncMap {
return syncMap{}
}
func (m *syncMap) Load(key interface{}) (interface{}, bool) {
return (*sync.Map)(m).Load(key)
}
func (m *syncMap) Store(key interface{}, value interface{}) {
(*sync.Map)(m).Store(key, value)
}
func (m *syncMap) Delete(key interface{}) {
(*sync.Map)(m).Delete(key)
}
func (m *syncMap) Range(f func(interface{}, interface{}) bool) {
(*sync.Map)(m).Range(f)
}

View File

@ -0,0 +1,48 @@
// +build !go1.9
package crr
import (
"sync"
)
type syncMap struct {
container map[interface{}]interface{}
lock sync.RWMutex
}
func newSyncMap() syncMap {
return syncMap{
container: map[interface{}]interface{}{},
}
}
func (m *syncMap) Load(key interface{}) (interface{}, bool) {
m.lock.RLock()
defer m.lock.RUnlock()
v, ok := m.container[key]
return v, ok
}
func (m *syncMap) Store(key interface{}, value interface{}) {
m.lock.Lock()
defer m.lock.Unlock()
m.container[key] = value
}
func (m *syncMap) Delete(key interface{}) {
m.lock.Lock()
defer m.lock.Unlock()
delete(m.container, key)
}
func (m *syncMap) Range(f func(interface{}, interface{}) bool) {
for k, v := range m.container {
if !f(k, v) {
return
}
}
}

View File

@ -227,9 +227,7 @@ func (rep *Reporter) InjectHandlers(handlers *request.Handlers) {
apiCallAttemptHandler := request.NamedHandler{Name: APICallAttemptMetricHandlerName, Fn: rep.sendAPICallAttemptMetric} apiCallAttemptHandler := request.NamedHandler{Name: APICallAttemptMetricHandlerName, Fn: rep.sendAPICallAttemptMetric}
handlers.Complete.PushFrontNamed(apiCallHandler) handlers.Complete.PushFrontNamed(apiCallHandler)
handlers.Complete.PushFrontNamed(apiCallAttemptHandler) handlers.CompleteAttempt.PushFrontNamed(apiCallAttemptHandler)
handlers.AfterRetry.PushFrontNamed(apiCallAttemptHandler)
} }
// boolIntValue return 1 for true and 0 for false. // boolIntValue return 1 for true and 0 for false.

View File

@ -95,7 +95,12 @@ func custAddS3DualStack(p *partition) {
return 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 { if !ok {
return return
} }
@ -103,7 +108,7 @@ func custAddS3DualStack(p *partition) {
s.Defaults.HasDualStack = boxedTrue s.Defaults.HasDualStack = boxedTrue
s.Defaults.DualStackHostname = "{service}.dualstack.{region}.{dnsSuffix}" s.Defaults.DualStackHostname = "{service}.dualstack.{region}.{dnsSuffix}"
p.Services["s3"] = s p.Services[svcName] = s
} }
func custAddEC2Metadata(p *partition) { func custAddEC2Metadata(p *partition) {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,141 @@
package endpoints
// Service identifiers
//
// Deprecated: Use client package's EndpointID value instead of these
// ServiceIDs. These IDs are not maintained, and are out of date.
const (
A4bServiceID = "a4b" // A4b.
AcmServiceID = "acm" // Acm.
AcmPcaServiceID = "acm-pca" // AcmPca.
ApiMediatailorServiceID = "api.mediatailor" // ApiMediatailor.
ApiPricingServiceID = "api.pricing" // ApiPricing.
ApiSagemakerServiceID = "api.sagemaker" // ApiSagemaker.
ApigatewayServiceID = "apigateway" // Apigateway.
ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling.
Appstream2ServiceID = "appstream2" // Appstream2.
AppsyncServiceID = "appsync" // Appsync.
AthenaServiceID = "athena" // Athena.
AutoscalingServiceID = "autoscaling" // Autoscaling.
AutoscalingPlansServiceID = "autoscaling-plans" // AutoscalingPlans.
BatchServiceID = "batch" // Batch.
BudgetsServiceID = "budgets" // Budgets.
CeServiceID = "ce" // Ce.
ChimeServiceID = "chime" // Chime.
Cloud9ServiceID = "cloud9" // Cloud9.
ClouddirectoryServiceID = "clouddirectory" // Clouddirectory.
CloudformationServiceID = "cloudformation" // Cloudformation.
CloudfrontServiceID = "cloudfront" // Cloudfront.
CloudhsmServiceID = "cloudhsm" // Cloudhsm.
Cloudhsmv2ServiceID = "cloudhsmv2" // Cloudhsmv2.
CloudsearchServiceID = "cloudsearch" // Cloudsearch.
CloudtrailServiceID = "cloudtrail" // Cloudtrail.
CodebuildServiceID = "codebuild" // Codebuild.
CodecommitServiceID = "codecommit" // Codecommit.
CodedeployServiceID = "codedeploy" // Codedeploy.
CodepipelineServiceID = "codepipeline" // Codepipeline.
CodestarServiceID = "codestar" // Codestar.
CognitoIdentityServiceID = "cognito-identity" // CognitoIdentity.
CognitoIdpServiceID = "cognito-idp" // CognitoIdp.
CognitoSyncServiceID = "cognito-sync" // CognitoSync.
ComprehendServiceID = "comprehend" // Comprehend.
ConfigServiceID = "config" // Config.
CurServiceID = "cur" // Cur.
DatapipelineServiceID = "datapipeline" // Datapipeline.
DaxServiceID = "dax" // Dax.
DevicefarmServiceID = "devicefarm" // Devicefarm.
DirectconnectServiceID = "directconnect" // Directconnect.
DiscoveryServiceID = "discovery" // Discovery.
DmsServiceID = "dms" // Dms.
DsServiceID = "ds" // Ds.
DynamodbServiceID = "dynamodb" // Dynamodb.
Ec2ServiceID = "ec2" // Ec2.
Ec2metadataServiceID = "ec2metadata" // Ec2metadata.
EcrServiceID = "ecr" // Ecr.
EcsServiceID = "ecs" // Ecs.
ElasticacheServiceID = "elasticache" // Elasticache.
ElasticbeanstalkServiceID = "elasticbeanstalk" // Elasticbeanstalk.
ElasticfilesystemServiceID = "elasticfilesystem" // Elasticfilesystem.
ElasticloadbalancingServiceID = "elasticloadbalancing" // Elasticloadbalancing.
ElasticmapreduceServiceID = "elasticmapreduce" // Elasticmapreduce.
ElastictranscoderServiceID = "elastictranscoder" // Elastictranscoder.
EmailServiceID = "email" // Email.
EntitlementMarketplaceServiceID = "entitlement.marketplace" // EntitlementMarketplace.
EsServiceID = "es" // Es.
EventsServiceID = "events" // Events.
FirehoseServiceID = "firehose" // Firehose.
FmsServiceID = "fms" // Fms.
GameliftServiceID = "gamelift" // Gamelift.
GlacierServiceID = "glacier" // Glacier.
GlueServiceID = "glue" // Glue.
GreengrassServiceID = "greengrass" // Greengrass.
GuarddutyServiceID = "guardduty" // Guardduty.
HealthServiceID = "health" // Health.
IamServiceID = "iam" // Iam.
ImportexportServiceID = "importexport" // Importexport.
InspectorServiceID = "inspector" // Inspector.
IotServiceID = "iot" // Iot.
IotanalyticsServiceID = "iotanalytics" // Iotanalytics.
KinesisServiceID = "kinesis" // Kinesis.
KinesisanalyticsServiceID = "kinesisanalytics" // Kinesisanalytics.
KinesisvideoServiceID = "kinesisvideo" // Kinesisvideo.
KmsServiceID = "kms" // Kms.
LambdaServiceID = "lambda" // Lambda.
LightsailServiceID = "lightsail" // Lightsail.
LogsServiceID = "logs" // Logs.
MachinelearningServiceID = "machinelearning" // Machinelearning.
MarketplacecommerceanalyticsServiceID = "marketplacecommerceanalytics" // Marketplacecommerceanalytics.
MediaconvertServiceID = "mediaconvert" // Mediaconvert.
MedialiveServiceID = "medialive" // Medialive.
MediapackageServiceID = "mediapackage" // Mediapackage.
MediastoreServiceID = "mediastore" // Mediastore.
MeteringMarketplaceServiceID = "metering.marketplace" // MeteringMarketplace.
MghServiceID = "mgh" // Mgh.
MobileanalyticsServiceID = "mobileanalytics" // Mobileanalytics.
ModelsLexServiceID = "models.lex" // ModelsLex.
MonitoringServiceID = "monitoring" // Monitoring.
MturkRequesterServiceID = "mturk-requester" // MturkRequester.
NeptuneServiceID = "neptune" // Neptune.
OpsworksServiceID = "opsworks" // Opsworks.
OpsworksCmServiceID = "opsworks-cm" // OpsworksCm.
OrganizationsServiceID = "organizations" // Organizations.
PinpointServiceID = "pinpoint" // Pinpoint.
PollyServiceID = "polly" // Polly.
RdsServiceID = "rds" // Rds.
RedshiftServiceID = "redshift" // Redshift.
RekognitionServiceID = "rekognition" // Rekognition.
ResourceGroupsServiceID = "resource-groups" // ResourceGroups.
Route53ServiceID = "route53" // Route53.
Route53domainsServiceID = "route53domains" // Route53domains.
RuntimeLexServiceID = "runtime.lex" // RuntimeLex.
RuntimeSagemakerServiceID = "runtime.sagemaker" // RuntimeSagemaker.
S3ServiceID = "s3" // S3.
S3ControlServiceID = "s3-control" // S3Control.
SagemakerServiceID = "api.sagemaker" // Sagemaker.
SdbServiceID = "sdb" // Sdb.
SecretsmanagerServiceID = "secretsmanager" // Secretsmanager.
ServerlessrepoServiceID = "serverlessrepo" // Serverlessrepo.
ServicecatalogServiceID = "servicecatalog" // Servicecatalog.
ServicediscoveryServiceID = "servicediscovery" // Servicediscovery.
ShieldServiceID = "shield" // Shield.
SmsServiceID = "sms" // Sms.
SnowballServiceID = "snowball" // Snowball.
SnsServiceID = "sns" // Sns.
SqsServiceID = "sqs" // Sqs.
SsmServiceID = "ssm" // Ssm.
StatesServiceID = "states" // States.
StoragegatewayServiceID = "storagegateway" // Storagegateway.
StreamsDynamodbServiceID = "streams.dynamodb" // StreamsDynamodb.
StsServiceID = "sts" // Sts.
SupportServiceID = "support" // Support.
SwfServiceID = "swf" // Swf.
TaggingServiceID = "tagging" // Tagging.
TransferServiceID = "transfer" // Transfer.
TranslateServiceID = "translate" // Translate.
WafServiceID = "waf" // Waf.
WafRegionalServiceID = "waf-regional" // WafRegional.
WorkdocsServiceID = "workdocs" // Workdocs.
WorkmailServiceID = "workmail" // Workmail.
WorkspacesServiceID = "workspaces" // Workspaces.
XrayServiceID = "xray" // Xray.
)

View File

@ -16,6 +16,10 @@ import (
type CodeGenOptions struct { type CodeGenOptions struct {
// Options for how the model will be decoded. // Options for how the model will be decoded.
DecodeModelOptions DecodeModelOptions DecodeModelOptions DecodeModelOptions
// Disables code generation of the service endpoint prefix IDs defined in
// the model.
DisableGenerateServiceIDs bool
} }
// Set combines all of the option functions together // Set combines all of the option functions together
@ -39,8 +43,16 @@ func CodeGenModel(modelFile io.Reader, outFile io.Writer, optFns ...func(*CodeGe
return err return err
} }
v := struct {
Resolver
CodeGenOptions
}{
Resolver: resolver,
CodeGenOptions: opts,
}
tmpl := template.Must(template.New("tmpl").Funcs(funcMap).Parse(v3Tmpl)) tmpl := template.Must(template.New("tmpl").Funcs(funcMap).Parse(v3Tmpl))
if err := tmpl.ExecuteTemplate(outFile, "defaults", resolver); err != nil { if err := tmpl.ExecuteTemplate(outFile, "defaults", v); err != nil {
return fmt.Errorf("failed to execute template, %v", err) return fmt.Errorf("failed to execute template, %v", err)
} }
@ -166,15 +178,17 @@ import (
"regexp" "regexp"
) )
{{ template "partition consts" . }} {{ template "partition consts" $.Resolver }}
{{ range $_, $partition := . }} {{ range $_, $partition := $.Resolver }}
{{ template "partition region consts" $partition }} {{ template "partition region consts" $partition }}
{{ end }} {{ end }}
{{ template "service consts" . }} {{ if not $.DisableGenerateServiceIDs -}}
{{ template "service consts" $.Resolver }}
{{- end }}
{{ template "endpoint resolvers" . }} {{ template "endpoint resolvers" $.Resolver }}
{{- end }} {{- end }}
{{ define "partition consts" }} {{ define "partition consts" }}

View File

@ -5,13 +5,9 @@ import "github.com/aws/aws-sdk-go/aws/awserr"
var ( var (
// ErrMissingRegion is an error that is returned if region configuration is // ErrMissingRegion is an error that is returned if region configuration is
// not found. // not found.
//
// @readonly
ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil)
// ErrMissingEndpoint is an error that is returned if an endpoint cannot be // ErrMissingEndpoint is an error that is returned if an endpoint cannot be
// resolved for a service. // resolved for a service.
//
// @readonly
ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil)
) )

View File

@ -19,6 +19,7 @@ type Handlers struct {
UnmarshalError HandlerList UnmarshalError HandlerList
Retry HandlerList Retry HandlerList
AfterRetry HandlerList AfterRetry HandlerList
CompleteAttempt HandlerList
Complete HandlerList Complete HandlerList
} }
@ -36,6 +37,7 @@ func (h *Handlers) Copy() Handlers {
UnmarshalMeta: h.UnmarshalMeta.copy(), UnmarshalMeta: h.UnmarshalMeta.copy(),
Retry: h.Retry.copy(), Retry: h.Retry.copy(),
AfterRetry: h.AfterRetry.copy(), AfterRetry: h.AfterRetry.copy(),
CompleteAttempt: h.CompleteAttempt.copy(),
Complete: h.Complete.copy(), Complete: h.Complete.copy(),
} }
} }
@ -53,6 +55,7 @@ func (h *Handlers) Clear() {
h.ValidateResponse.Clear() h.ValidateResponse.Clear()
h.Retry.Clear() h.Retry.Clear()
h.AfterRetry.Clear() h.AfterRetry.Clear()
h.CompleteAttempt.Clear()
h.Complete.Clear() h.Complete.Clear()
} }

View File

@ -122,7 +122,6 @@ func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers,
Handlers: handlers.Copy(), Handlers: handlers.Copy(),
Retryer: retryer, Retryer: retryer,
AttemptTime: time.Now(),
Time: time.Now(), Time: time.Now(),
ExpireTime: 0, ExpireTime: 0,
Operation: operation, Operation: operation,
@ -266,7 +265,9 @@ func (r *Request) SetReaderBody(reader io.ReadSeeker) {
} }
// Presign returns the request's signed URL. Error will be returned // Presign returns the request's signed URL. Error will be returned
// if the signing fails. // if the signing fails. The expire parameter is only used for presigned Amazon
// S3 API requests. All other AWS services will use a fixed expriation
// time of 15 minutes.
// //
// It is invalid to create a presigned URL with a expire duration 0 or less. An // It is invalid to create a presigned URL with a expire duration 0 or less. An
// error is returned if expire duration is 0 or less. // error is returned if expire duration is 0 or less.
@ -283,7 +284,9 @@ func (r *Request) Presign(expire time.Duration) (string, error) {
} }
// PresignRequest behaves just like presign, with the addition of returning a // PresignRequest behaves just like presign, with the addition of returning a
// set of headers that were signed. // set of headers that were signed. The expire parameter is only used for
// presigned Amazon S3 API requests. All other AWS services will use a fixed
// expriation time of 15 minutes.
// //
// It is invalid to create a presigned URL with a expire duration 0 or less. An // It is invalid to create a presigned URL with a expire duration 0 or less. An
// error is returned if expire duration is 0 or less. // error is returned if expire duration is 0 or less.
@ -462,80 +465,78 @@ func (r *Request) Send() error {
r.Handlers.Complete.Run(r) r.Handlers.Complete.Run(r)
}() }()
if err := r.Error; err != nil {
return err
}
for { for {
r.Error = nil
r.AttemptTime = time.Now() r.AttemptTime = time.Now()
if aws.BoolValue(r.Retryable) {
if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount))
}
// The previous http.Request will have a reference to the r.Body if err := r.Sign(); err != nil {
// and the HTTP Client's Transport may still be reading from debugLogReqError(r, "Sign Request", false, err)
// the request's body even though the Client's Do returned. return err
r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil)
r.ResetBody()
// Closing response body to ensure that no response body is leaked
// between retry attempts.
if r.HTTPResponse != nil && r.HTTPResponse.Body != nil {
r.HTTPResponse.Body.Close()
}
} }
r.Sign() if err := r.sendRequest(); err == nil {
if r.Error != nil { return nil
return r.Error } else if !shouldRetryCancel(r) {
} return err
} else {
r.Retryable = nil
r.Handlers.Send.Run(r)
if r.Error != nil {
if !shouldRetryCancel(r) {
return r.Error
}
err := r.Error
r.Handlers.Retry.Run(r) r.Handlers.Retry.Run(r)
r.Handlers.AfterRetry.Run(r) r.Handlers.AfterRetry.Run(r)
if r.Error != nil {
debugLogReqError(r, "Send Request", false, err) if r.Error != nil || !aws.BoolValue(r.Retryable) {
return r.Error return r.Error
} }
debugLogReqError(r, "Send Request", true, err)
r.prepareRetry()
continue continue
} }
r.Handlers.UnmarshalMeta.Run(r) }
r.Handlers.ValidateResponse.Run(r) }
if r.Error != nil {
r.Handlers.UnmarshalError.Run(r)
err := r.Error
r.Handlers.Retry.Run(r) func (r *Request) prepareRetry() {
r.Handlers.AfterRetry.Run(r) if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
if r.Error != nil { r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
debugLogReqError(r, "Validate Response", false, err) r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount))
return r.Error }
}
debugLogReqError(r, "Validate Response", true, err)
continue
}
r.Handlers.Unmarshal.Run(r) // The previous http.Request will have a reference to the r.Body
if r.Error != nil { // and the HTTP Client's Transport may still be reading from
err := r.Error // the request's body even though the Client's Do returned.
r.Handlers.Retry.Run(r) r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil)
r.Handlers.AfterRetry.Run(r) r.ResetBody()
if r.Error != nil {
debugLogReqError(r, "Unmarshal Response", false, err)
return r.Error
}
debugLogReqError(r, "Unmarshal Response", true, err)
continue
}
break // Closing response body to ensure that no response body is leaked
// between retry attempts.
if r.HTTPResponse != nil && r.HTTPResponse.Body != nil {
r.HTTPResponse.Body.Close()
}
}
func (r *Request) sendRequest() (sendErr error) {
defer r.Handlers.CompleteAttempt.Run(r)
r.Retryable = nil
r.Handlers.Send.Run(r)
if r.Error != nil {
debugLogReqError(r, "Send Request", r.WillRetry(), r.Error)
return r.Error
}
r.Handlers.UnmarshalMeta.Run(r)
r.Handlers.ValidateResponse.Run(r)
if r.Error != nil {
r.Handlers.UnmarshalError.Run(r)
debugLogReqError(r, "Validate Response", r.WillRetry(), r.Error)
return r.Error
}
r.Handlers.Unmarshal.Run(r)
if r.Error != nil {
debugLogReqError(r, "Unmarshal Response", r.WillRetry(), r.Error)
return r.Error
} }
return nil return nil

View File

@ -40,6 +40,7 @@ var throttleCodes = map[string]struct{}{
"RequestThrottled": {}, "RequestThrottled": {},
"TooManyRequestsException": {}, // Lambda functions "TooManyRequestsException": {}, // Lambda functions
"PriorRequestNotComplete": {}, // Route53 "PriorRequestNotComplete": {}, // Route53
"TransactionInProgressException": {},
} }
// credsExpiredCodes is a collection of error codes which signify the credentials // credsExpiredCodes is a collection of error codes which signify the credentials

View File

@ -17,6 +17,8 @@ const (
ParamMinValueErrCode = "ParamMinValueError" ParamMinValueErrCode = "ParamMinValueError"
// ParamMinLenErrCode is the error code for fields without enough elements. // ParamMinLenErrCode is the error code for fields without enough elements.
ParamMinLenErrCode = "ParamMinLenError" ParamMinLenErrCode = "ParamMinLenError"
// ParamMaxLenErrCode is the error code for value being too long.
ParamMaxLenErrCode = "ParamMaxLenError"
// ParamFormatErrCode is the error code for a field with invalid // ParamFormatErrCode is the error code for a field with invalid
// format or characters. // format or characters.
@ -237,6 +239,29 @@ func (e *ErrParamMinLen) MinLen() int {
return e.min return e.min
} }
// An ErrParamMaxLen represents a maximum length parameter error.
type ErrParamMaxLen struct {
errInvalidParam
max int
}
// NewErrParamMaxLen creates a new maximum length parameter error.
func NewErrParamMaxLen(field string, max int, value string) *ErrParamMaxLen {
return &ErrParamMaxLen{
errInvalidParam: errInvalidParam{
code: ParamMaxLenErrCode,
field: field,
msg: fmt.Sprintf("maximum size of %v, %v", max, value),
},
max: max,
}
}
// MaxLen returns the field's required minimum length.
func (e *ErrParamMaxLen) MaxLen() int {
return e.max
}
// An ErrParamFormat represents a invalid format parameter error. // An ErrParamFormat represents a invalid format parameter error.
type ErrParamFormat struct { type ErrParamFormat struct {
errInvalidParam errInvalidParam

View File

@ -99,7 +99,7 @@ handler logs every request and its payload made by a service client:
sess.Handlers.Send.PushFront(func(r *request.Request) { sess.Handlers.Send.PushFront(func(r *request.Request) {
// Log every request made and its payload // Log every request made and its payload
logger.Println("Request: %s/%s, Payload: %s", logger.Printf("Request: %s/%s, Payload: %s",
r.ClientInfo.ServiceName, r.Operation, r.Params) r.ClientInfo.ServiceName, r.Operation, r.Params)
}) })

View File

@ -4,6 +4,7 @@ import (
"os" "os"
"strconv" "strconv"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/defaults" "github.com/aws/aws-sdk-go/aws/defaults"
) )
@ -101,6 +102,12 @@ type envConfig struct {
CSMEnabled bool CSMEnabled bool
CSMPort string CSMPort string
CSMClientID string CSMClientID string
enableEndpointDiscovery string
// Enables endpoint discovery via environment variables.
//
// AWS_ENABLE_ENDPOINT_DISCOVERY=true
EnableEndpointDiscovery *bool
} }
var ( var (
@ -125,6 +132,10 @@ var (
"AWS_SESSION_TOKEN", "AWS_SESSION_TOKEN",
} }
enableEndpointDiscoveryEnvKey = []string{
"AWS_ENABLE_ENDPOINT_DISCOVERY",
}
regionEnvKeys = []string{ regionEnvKeys = []string{
"AWS_REGION", "AWS_REGION",
"AWS_DEFAULT_REGION", // Only read if AWS_SDK_LOAD_CONFIG is also set "AWS_DEFAULT_REGION", // Only read if AWS_SDK_LOAD_CONFIG is also set
@ -194,6 +205,12 @@ func envConfigLoad(enableSharedConfig bool) envConfig {
setFromEnvVal(&cfg.Region, regionKeys) setFromEnvVal(&cfg.Region, regionKeys)
setFromEnvVal(&cfg.Profile, profileKeys) setFromEnvVal(&cfg.Profile, profileKeys)
// endpoint discovery is in reference to it being enabled.
setFromEnvVal(&cfg.enableEndpointDiscovery, enableEndpointDiscoveryEnvKey)
if len(cfg.enableEndpointDiscovery) > 0 {
cfg.EnableEndpointDiscovery = aws.Bool(cfg.enableEndpointDiscovery != "false")
}
setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey) setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey)
setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey) setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey)

View File

@ -14,6 +14,7 @@ import (
"github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/corehandlers" "github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/processcreds"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/csm" "github.com/aws/aws-sdk-go/aws/csm"
"github.com/aws/aws-sdk-go/aws/defaults" "github.com/aws/aws-sdk-go/aws/defaults"
@ -452,6 +453,14 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share
} }
} }
if cfg.EnableEndpointDiscovery == nil {
if envCfg.EnableEndpointDiscovery != nil {
cfg.WithEndpointDiscovery(*envCfg.EnableEndpointDiscovery)
} else if envCfg.EnableSharedConfig && sharedCfg.EnableEndpointDiscovery != nil {
cfg.WithEndpointDiscovery(*sharedCfg.EnableEndpointDiscovery)
}
}
// Configure credentials if not already set // Configure credentials if not already set
if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil {
@ -526,6 +535,10 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share
cfg.Credentials = credentials.NewStaticCredentialsFromCreds( cfg.Credentials = credentials.NewStaticCredentialsFromCreds(
sharedCfg.Creds, sharedCfg.Creds,
) )
} else if len(sharedCfg.CredentialProcess) > 0 {
cfg.Credentials = processcreds.NewCredentials(
sharedCfg.CredentialProcess,
)
} else { } else {
// Fallback to default credentials provider, include mock errors // Fallback to default credentials provider, include mock errors
// for the credential chain so user can identify why credentials // for the credential chain so user can identify why credentials

View File

@ -2,11 +2,11 @@ package session
import ( import (
"fmt" "fmt"
"io/ioutil"
"github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials"
"github.com/go-ini/ini"
"github.com/aws/aws-sdk-go/internal/ini"
) )
const ( const (
@ -26,6 +26,11 @@ const (
// Additional Config fields // Additional Config fields
regionKey = `region` regionKey = `region`
// endpoint discovery group
enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional
// External Credential Process
credentialProcessKey = `credential_process`
// DefaultSharedConfigProfile is the default profile to be used when // DefaultSharedConfigProfile is the default profile to be used when
// loading configuration from the config files if another profile name // loading configuration from the config files if another profile name
// is not provided. // is not provided.
@ -57,16 +62,25 @@ type sharedConfig struct {
AssumeRole assumeRoleConfig AssumeRole assumeRoleConfig
AssumeRoleSource *sharedConfig AssumeRoleSource *sharedConfig
// An external process to request credentials
CredentialProcess string
// Region is the region the SDK should use for looking up AWS service endpoints // Region is the region the SDK should use for looking up AWS service endpoints
// and signing requests. // and signing requests.
// //
// region // region
Region string Region string
// EnableEndpointDiscovery can be enabled in the shared config by setting
// endpoint_discovery_enabled to true
//
// endpoint_discovery_enabled = true
EnableEndpointDiscovery *bool
} }
type sharedConfigFile struct { type sharedConfigFile struct {
Filename string Filename string
IniData *ini.File IniData ini.Sections
} }
// loadSharedConfig retrieves the configuration from the list of files // loadSharedConfig retrieves the configuration from the list of files
@ -107,19 +121,16 @@ func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) {
files := make([]sharedConfigFile, 0, len(filenames)) files := make([]sharedConfigFile, 0, len(filenames))
for _, filename := range filenames { for _, filename := range filenames {
b, err := ioutil.ReadFile(filename) sections, err := ini.OpenFile(filename)
if err != nil { if aerr, ok := err.(awserr.Error); ok && aerr.Code() == ini.ErrCodeUnableToReadFile {
// Skip files which can't be opened and read for whatever reason // Skip files which can't be opened and read for whatever reason
continue continue
} } else if err != nil {
f, err := ini.Load(b)
if err != nil {
return nil, SharedConfigLoadError{Filename: filename, Err: err} return nil, SharedConfigLoadError{Filename: filename, Err: err}
} }
files = append(files, sharedConfigFile{ files = append(files, sharedConfigFile{
Filename: filename, IniData: f, Filename: filename, IniData: sections,
}) })
} }
@ -180,48 +191,59 @@ func (cfg *sharedConfig) setFromIniFiles(profile string, files []sharedConfigFil
// if a config file only includes aws_access_key_id but no aws_secret_access_key // if a config file only includes aws_access_key_id but no aws_secret_access_key
// the aws_access_key_id will be ignored. // the aws_access_key_id will be ignored.
func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) error { func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) error {
section, err := file.IniData.GetSection(profile) section, ok := file.IniData.GetSection(profile)
if err != nil { if !ok {
// Fallback to to alternate profile name: profile <name> // Fallback to to alternate profile name: profile <name>
section, err = file.IniData.GetSection(fmt.Sprintf("profile %s", profile)) section, ok = file.IniData.GetSection(fmt.Sprintf("profile %s", profile))
if err != nil { if !ok {
return SharedConfigProfileNotExistsError{Profile: profile, Err: err} return SharedConfigProfileNotExistsError{Profile: profile, Err: nil}
} }
} }
// Shared Credentials // Shared Credentials
akid := section.Key(accessKeyIDKey).String() akid := section.String(accessKeyIDKey)
secret := section.Key(secretAccessKey).String() secret := section.String(secretAccessKey)
if len(akid) > 0 && len(secret) > 0 { if len(akid) > 0 && len(secret) > 0 {
cfg.Creds = credentials.Value{ cfg.Creds = credentials.Value{
AccessKeyID: akid, AccessKeyID: akid,
SecretAccessKey: secret, SecretAccessKey: secret,
SessionToken: section.Key(sessionTokenKey).String(), SessionToken: section.String(sessionTokenKey),
ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename),
} }
} }
// Assume Role // Assume Role
roleArn := section.Key(roleArnKey).String() roleArn := section.String(roleArnKey)
srcProfile := section.Key(sourceProfileKey).String() srcProfile := section.String(sourceProfileKey)
credentialSource := section.Key(credentialSourceKey).String() credentialSource := section.String(credentialSourceKey)
hasSource := len(srcProfile) > 0 || len(credentialSource) > 0 hasSource := len(srcProfile) > 0 || len(credentialSource) > 0
if len(roleArn) > 0 && hasSource { if len(roleArn) > 0 && hasSource {
cfg.AssumeRole = assumeRoleConfig{ cfg.AssumeRole = assumeRoleConfig{
RoleARN: roleArn, RoleARN: roleArn,
SourceProfile: srcProfile, SourceProfile: srcProfile,
CredentialSource: credentialSource, CredentialSource: credentialSource,
ExternalID: section.Key(externalIDKey).String(), ExternalID: section.String(externalIDKey),
MFASerial: section.Key(mfaSerialKey).String(), MFASerial: section.String(mfaSerialKey),
RoleSessionName: section.Key(roleSessionNameKey).String(), RoleSessionName: section.String(roleSessionNameKey),
} }
} }
// `credential_process`
if credProc := section.String(credentialProcessKey); len(credProc) > 0 {
cfg.CredentialProcess = credProc
}
// Region // Region
if v := section.Key(regionKey).String(); len(v) > 0 { if v := section.String(regionKey); len(v) > 0 {
cfg.Region = v cfg.Region = v
} }
// Endpoint discovery
if section.Has(enableEndpointDiscoveryKey) {
v := section.Bool(enableEndpointDiscoveryKey)
cfg.EnableEndpointDiscovery = &v
}
return nil return nil
} }

View File

@ -98,25 +98,25 @@ var ignoredHeaders = rules{
var requiredSignedHeaders = rules{ var requiredSignedHeaders = rules{
whitelist{ whitelist{
mapRule{ mapRule{
"Cache-Control": struct{}{}, "Cache-Control": struct{}{},
"Content-Disposition": struct{}{}, "Content-Disposition": struct{}{},
"Content-Encoding": struct{}{}, "Content-Encoding": struct{}{},
"Content-Language": struct{}{}, "Content-Language": struct{}{},
"Content-Md5": struct{}{}, "Content-Md5": struct{}{},
"Content-Type": struct{}{}, "Content-Type": struct{}{},
"Expires": struct{}{}, "Expires": struct{}{},
"If-Match": struct{}{}, "If-Match": struct{}{},
"If-Modified-Since": struct{}{}, "If-Modified-Since": struct{}{},
"If-None-Match": struct{}{}, "If-None-Match": struct{}{},
"If-Unmodified-Since": struct{}{}, "If-Unmodified-Since": struct{}{},
"Range": struct{}{}, "Range": struct{}{},
"X-Amz-Acl": struct{}{}, "X-Amz-Acl": struct{}{},
"X-Amz-Copy-Source": struct{}{}, "X-Amz-Copy-Source": struct{}{},
"X-Amz-Copy-Source-If-Match": struct{}{}, "X-Amz-Copy-Source-If-Match": struct{}{},
"X-Amz-Copy-Source-If-Modified-Since": struct{}{}, "X-Amz-Copy-Source-If-Modified-Since": struct{}{},
"X-Amz-Copy-Source-If-None-Match": struct{}{}, "X-Amz-Copy-Source-If-None-Match": struct{}{},
"X-Amz-Copy-Source-If-Unmodified-Since": struct{}{}, "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{},
"X-Amz-Copy-Source-Range": struct{}{}, "X-Amz-Copy-Source-Range": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{},
@ -134,6 +134,7 @@ var requiredSignedHeaders = rules{
"X-Amz-Server-Side-Encryption-Customer-Key": struct{}{}, "X-Amz-Server-Side-Encryption-Customer-Key": struct{}{},
"X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, "X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{},
"X-Amz-Storage-Class": struct{}{}, "X-Amz-Storage-Class": struct{}{},
"X-Amz-Tagging": struct{}{},
"X-Amz-Website-Redirect-Location": struct{}{}, "X-Amz-Website-Redirect-Location": struct{}{},
"X-Amz-Content-Sha256": struct{}{}, "X-Amz-Content-Sha256": struct{}{},
}, },
@ -421,7 +422,7 @@ var SignRequestHandler = request.NamedHandler{
// If the credentials of the request's config are set to // If the credentials of the request's config are set to
// credentials.AnonymousCredentials the request will not be signed. // credentials.AnonymousCredentials the request will not be signed.
func SignSDKRequest(req *request.Request) { func SignSDKRequest(req *request.Request) {
signSDKRequestWithCurrTime(req, time.Now) SignSDKRequestWithCurrentTime(req, time.Now)
} }
// BuildNamedHandler will build a generic handler for signing. // BuildNamedHandler will build a generic handler for signing.
@ -429,12 +430,15 @@ func BuildNamedHandler(name string, opts ...func(*Signer)) request.NamedHandler
return request.NamedHandler{ return request.NamedHandler{
Name: name, Name: name,
Fn: func(req *request.Request) { Fn: func(req *request.Request) {
signSDKRequestWithCurrTime(req, time.Now, opts...) SignSDKRequestWithCurrentTime(req, time.Now, opts...)
}, },
} }
} }
func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) { // SignSDKRequestWithCurrentTime will sign the SDK's request using the time
// function passed in. Behaves the same as SignSDKRequest with the exception
// the request is signed with the value returned by the current time function.
func SignSDKRequestWithCurrentTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) {
// If the request does not need to be signed ignore the signing of the // If the request does not need to be signed ignore the signing of the
// request if the AnonymousCredentials object is used. // request if the AnonymousCredentials object is used.
if req.Config.Credentials == credentials.AnonymousCredentials { if req.Config.Credentials == credentials.AnonymousCredentials {
@ -470,13 +474,9 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time
opt(v4) opt(v4)
} }
signingTime := req.Time curTime := curTimeFn()
if !req.LastSignedAt.IsZero() {
signingTime = req.LastSignedAt
}
signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.GetBody(), signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.GetBody(),
name, region, req.ExpireTime, req.ExpireTime > 0, signingTime, name, region, req.ExpireTime, req.ExpireTime > 0, curTime,
) )
if err != nil { if err != nil {
req.Error = err req.Error = err
@ -485,7 +485,7 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time
} }
req.SignedHeaderVals = signedHeaders req.SignedHeaderVals = signedHeaders
req.LastSignedAt = curTimeFn() req.LastSignedAt = curTime
} }
const logSignInfoMsg = `DEBUG: Request Signature: const logSignInfoMsg = `DEBUG: Request Signature:

View File

@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go" const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK // SDKVersion is the version of this SDK
const SDKVersion = "1.15.55" const SDKVersion = "1.16.4"

120
vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go generated vendored Normal file
View File

@ -0,0 +1,120 @@
package ini
// ASTKind represents different states in the parse table
// and the type of AST that is being constructed
type ASTKind int
// ASTKind* is used in the parse table to transition between
// the different states
const (
ASTKindNone = ASTKind(iota)
ASTKindStart
ASTKindExpr
ASTKindEqualExpr
ASTKindStatement
ASTKindSkipStatement
ASTKindExprStatement
ASTKindSectionStatement
ASTKindNestedSectionStatement
ASTKindCompletedNestedSectionStatement
ASTKindCommentStatement
ASTKindCompletedSectionStatement
)
func (k ASTKind) String() string {
switch k {
case ASTKindNone:
return "none"
case ASTKindStart:
return "start"
case ASTKindExpr:
return "expr"
case ASTKindStatement:
return "stmt"
case ASTKindSectionStatement:
return "section_stmt"
case ASTKindExprStatement:
return "expr_stmt"
case ASTKindCommentStatement:
return "comment"
case ASTKindNestedSectionStatement:
return "nested_section_stmt"
case ASTKindCompletedSectionStatement:
return "completed_stmt"
case ASTKindSkipStatement:
return "skip"
default:
return ""
}
}
// AST interface allows us to determine what kind of node we
// are on and casting may not need to be necessary.
//
// The root is always the first node in Children
type AST struct {
Kind ASTKind
Root Token
RootToken bool
Children []AST
}
func newAST(kind ASTKind, root AST, children ...AST) AST {
return AST{
Kind: kind,
Children: append([]AST{root}, children...),
}
}
func newASTWithRootToken(kind ASTKind, root Token, children ...AST) AST {
return AST{
Kind: kind,
Root: root,
RootToken: true,
Children: children,
}
}
// AppendChild will append to the list of children an AST has.
func (a *AST) AppendChild(child AST) {
a.Children = append(a.Children, child)
}
// GetRoot will return the root AST which can be the first entry
// in the children list or a token.
func (a *AST) GetRoot() AST {
if a.RootToken {
return *a
}
if len(a.Children) == 0 {
return AST{}
}
return a.Children[0]
}
// GetChildren will return the current AST's list of children
func (a *AST) GetChildren() []AST {
if len(a.Children) == 0 {
return []AST{}
}
if a.RootToken {
return a.Children
}
return a.Children[1:]
}
// SetChildren will set and override all children of the AST.
func (a *AST) SetChildren(children []AST) {
if a.RootToken {
a.Children = children
} else {
a.Children = append(a.Children[:1], children...)
}
}
// Start is used to indicate the starting state of the parse table.
var Start = newAST(ASTKindStart, AST{})

View File

@ -0,0 +1,11 @@
package ini
var commaRunes = []rune(",")
func isComma(b rune) bool {
return b == ','
}
func newCommaToken() Token {
return newToken(TokenComma, commaRunes, NoneType)
}

View File

@ -0,0 +1,35 @@
package ini
// isComment will return whether or not the next byte(s) is a
// comment.
func isComment(b []rune) bool {
if len(b) == 0 {
return false
}
switch b[0] {
case ';':
return true
case '#':
return true
}
return false
}
// newCommentToken will create a comment token and
// return how many bytes were read.
func newCommentToken(b []rune) (Token, int, error) {
i := 0
for ; i < len(b); i++ {
if b[i] == '\n' {
break
}
if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' {
break
}
}
return newToken(TokenComment, b[:i], NoneType), i, nil
}

29
vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go generated vendored Normal file
View File

@ -0,0 +1,29 @@
// Package ini is an LL(1) parser for configuration files.
//
// Example:
// sections, err := ini.OpenFile("/path/to/file")
// if err != nil {
// panic(err)
// }
//
// profile := "foo"
// section, ok := sections.GetSection(profile)
// if !ok {
// fmt.Printf("section %q could not be found", profile)
// }
//
// Below is the BNF that describes this parser
// Grammar:
// stmt -> value stmt'
// stmt' -> epsilon | op stmt
// value -> number | string | boolean | quoted_string
//
// section -> [ section'
// section' -> value section_close
// section_close -> ]
//
// SkipState will skip (NL WS)+
//
// comment -> # comment' | ; comment'
// comment' -> epsilon | value
package ini

View File

@ -0,0 +1,4 @@
package ini
// emptyToken is used to satisfy the Token interface
var emptyToken = newToken(TokenNone, []rune{}, NoneType)

View File

@ -0,0 +1,24 @@
package ini
// newExpression will return an expression AST.
// Expr represents an expression
//
// grammar:
// expr -> string | number
func newExpression(tok Token) AST {
return newASTWithRootToken(ASTKindExpr, tok)
}
func newEqualExpr(left AST, tok Token) AST {
return newASTWithRootToken(ASTKindEqualExpr, tok, left)
}
// EqualExprKey will return a LHS value in the equal expr
func EqualExprKey(ast AST) string {
children := ast.GetChildren()
if len(children) == 0 || ast.Kind != ASTKindEqualExpr {
return ""
}
return string(children[0].Root.Raw())
}

17
vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go generated vendored Normal file
View File

@ -0,0 +1,17 @@
// +build gofuzz
package ini
import (
"bytes"
)
func Fuzz(data []byte) int {
b := bytes.NewReader(data)
if _, err := Parse(b); err != nil {
return 0
}
return 1
}

51
vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go generated vendored Normal file
View File

@ -0,0 +1,51 @@
package ini
import (
"io"
"os"
"github.com/aws/aws-sdk-go/aws/awserr"
)
// OpenFile takes a path to a given file, and will open and parse
// that file.
func OpenFile(path string) (Sections, error) {
f, err := os.Open(path)
if err != nil {
return Sections{}, awserr.New(ErrCodeUnableToReadFile, "unable to open file", err)
}
defer f.Close()
return Parse(f)
}
// Parse will parse the given file using the shared config
// visitor.
func Parse(f io.Reader) (Sections, error) {
tree, err := ParseAST(f)
if err != nil {
return Sections{}, err
}
v := NewDefaultVisitor()
if err = Walk(tree, v); err != nil {
return Sections{}, err
}
return v.Sections, nil
}
// ParseBytes will parse the given bytes and return the parsed sections.
func ParseBytes(b []byte) (Sections, error) {
tree, err := ParseASTBytes(b)
if err != nil {
return Sections{}, err
}
v := NewDefaultVisitor()
if err = Walk(tree, v); err != nil {
return Sections{}, err
}
return v.Sections, nil
}

View File

@ -0,0 +1,165 @@
package ini
import (
"bytes"
"io"
"io/ioutil"
"github.com/aws/aws-sdk-go/aws/awserr"
)
const (
// ErrCodeUnableToReadFile is used when a file is failed to be
// opened or read from.
ErrCodeUnableToReadFile = "FailedRead"
)
// TokenType represents the various different tokens types
type TokenType int
func (t TokenType) String() string {
switch t {
case TokenNone:
return "none"
case TokenLit:
return "literal"
case TokenSep:
return "sep"
case TokenOp:
return "op"
case TokenWS:
return "ws"
case TokenNL:
return "newline"
case TokenComment:
return "comment"
case TokenComma:
return "comma"
default:
return ""
}
}
// TokenType enums
const (
TokenNone = TokenType(iota)
TokenLit
TokenSep
TokenComma
TokenOp
TokenWS
TokenNL
TokenComment
)
type iniLexer struct{}
// Tokenize will return a list of tokens during lexical analysis of the
// io.Reader.
func (l *iniLexer) Tokenize(r io.Reader) ([]Token, error) {
b, err := ioutil.ReadAll(r)
if err != nil {
return nil, awserr.New(ErrCodeUnableToReadFile, "unable to read file", err)
}
return l.tokenize(b)
}
func (l *iniLexer) tokenize(b []byte) ([]Token, error) {
runes := bytes.Runes(b)
var err error
n := 0
tokenAmount := countTokens(runes)
tokens := make([]Token, tokenAmount)
count := 0
for len(runes) > 0 && count < tokenAmount {
switch {
case isWhitespace(runes[0]):
tokens[count], n, err = newWSToken(runes)
case isComma(runes[0]):
tokens[count], n = newCommaToken(), 1
case isComment(runes):
tokens[count], n, err = newCommentToken(runes)
case isNewline(runes):
tokens[count], n, err = newNewlineToken(runes)
case isSep(runes):
tokens[count], n, err = newSepToken(runes)
case isOp(runes):
tokens[count], n, err = newOpToken(runes)
default:
tokens[count], n, err = newLitToken(runes)
}
if err != nil {
return nil, err
}
count++
runes = runes[n:]
}
return tokens[:count], nil
}
func countTokens(runes []rune) int {
count, n := 0, 0
var err error
for len(runes) > 0 {
switch {
case isWhitespace(runes[0]):
_, n, err = newWSToken(runes)
case isComma(runes[0]):
_, n = newCommaToken(), 1
case isComment(runes):
_, n, err = newCommentToken(runes)
case isNewline(runes):
_, n, err = newNewlineToken(runes)
case isSep(runes):
_, n, err = newSepToken(runes)
case isOp(runes):
_, n, err = newOpToken(runes)
default:
_, n, err = newLitToken(runes)
}
if err != nil {
return 0
}
count++
runes = runes[n:]
}
return count + 1
}
// Token indicates a metadata about a given value.
type Token struct {
t TokenType
ValueType ValueType
base int
raw []rune
}
var emptyValue = Value{}
func newToken(t TokenType, raw []rune, v ValueType) Token {
return Token{
t: t,
raw: raw,
ValueType: v,
}
}
// Raw return the raw runes that were consumed
func (tok Token) Raw() []rune {
return tok.raw
}
// Type returns the token type
func (tok Token) Type() TokenType {
return tok.t
}

View File

@ -0,0 +1,347 @@
package ini
import (
"fmt"
"io"
)
// State enums for the parse table
const (
InvalidState = iota
// stmt -> value stmt'
StatementState
// stmt' -> MarkComplete | op stmt
StatementPrimeState
// value -> number | string | boolean | quoted_string
ValueState
// section -> [ section'
OpenScopeState
// section' -> value section_close
SectionState
// section_close -> ]
CloseScopeState
// SkipState will skip (NL WS)+
SkipState
// SkipTokenState will skip any token and push the previous
// state onto the stack.
SkipTokenState
// comment -> # comment' | ; comment'
// comment' -> MarkComplete | value
CommentState
// MarkComplete state will complete statements and move that
// to the completed AST list
MarkCompleteState
// TerminalState signifies that the tokens have been fully parsed
TerminalState
)
// parseTable is a state machine to dictate the grammar above.
var parseTable = map[ASTKind]map[TokenType]int{
ASTKindStart: map[TokenType]int{
TokenLit: StatementState,
TokenSep: OpenScopeState,
TokenWS: SkipTokenState,
TokenNL: SkipTokenState,
TokenComment: CommentState,
TokenNone: TerminalState,
},
ASTKindCommentStatement: map[TokenType]int{
TokenLit: StatementState,
TokenSep: OpenScopeState,
TokenWS: SkipTokenState,
TokenNL: SkipTokenState,
TokenComment: CommentState,
TokenNone: MarkCompleteState,
},
ASTKindExpr: map[TokenType]int{
TokenOp: StatementPrimeState,
TokenLit: ValueState,
TokenSep: OpenScopeState,
TokenWS: ValueState,
TokenNL: SkipState,
TokenComment: CommentState,
TokenNone: MarkCompleteState,
},
ASTKindEqualExpr: map[TokenType]int{
TokenLit: ValueState,
TokenWS: SkipTokenState,
TokenNL: SkipState,
},
ASTKindStatement: map[TokenType]int{
TokenLit: SectionState,
TokenSep: CloseScopeState,
TokenWS: SkipTokenState,
TokenNL: SkipTokenState,
TokenComment: CommentState,
TokenNone: MarkCompleteState,
},
ASTKindExprStatement: map[TokenType]int{
TokenLit: ValueState,
TokenSep: OpenScopeState,
TokenOp: ValueState,
TokenWS: ValueState,
TokenNL: MarkCompleteState,
TokenComment: CommentState,
TokenNone: TerminalState,
TokenComma: SkipState,
},
ASTKindSectionStatement: map[TokenType]int{
TokenLit: SectionState,
TokenOp: SectionState,
TokenSep: CloseScopeState,
TokenWS: SectionState,
TokenNL: SkipTokenState,
},
ASTKindCompletedSectionStatement: map[TokenType]int{
TokenWS: SkipTokenState,
TokenNL: SkipTokenState,
TokenLit: StatementState,
TokenSep: OpenScopeState,
TokenComment: CommentState,
TokenNone: MarkCompleteState,
},
ASTKindSkipStatement: map[TokenType]int{
TokenLit: StatementState,
TokenSep: OpenScopeState,
TokenWS: SkipTokenState,
TokenNL: SkipTokenState,
TokenComment: CommentState,
TokenNone: TerminalState,
},
}
// ParseAST will parse input from an io.Reader using
// an LL(1) parser.
func ParseAST(r io.Reader) ([]AST, error) {
lexer := iniLexer{}
tokens, err := lexer.Tokenize(r)
if err != nil {
return []AST{}, err
}
return parse(tokens)
}
// ParseASTBytes will parse input from a byte slice using
// an LL(1) parser.
func ParseASTBytes(b []byte) ([]AST, error) {
lexer := iniLexer{}
tokens, err := lexer.tokenize(b)
if err != nil {
return []AST{}, err
}
return parse(tokens)
}
func parse(tokens []Token) ([]AST, error) {
start := Start
stack := newParseStack(3, len(tokens))
stack.Push(start)
s := newSkipper()
loop:
for stack.Len() > 0 {
k := stack.Pop()
var tok Token
if len(tokens) == 0 {
// this occurs when all the tokens have been processed
// but reduction of what's left on the stack needs to
// occur.
tok = emptyToken
} else {
tok = tokens[0]
}
step := parseTable[k.Kind][tok.Type()]
if s.ShouldSkip(tok) {
// being in a skip state with no tokens will break out of
// the parse loop since there is nothing left to process.
if len(tokens) == 0 {
break loop
}
step = SkipTokenState
}
switch step {
case TerminalState:
// Finished parsing. Push what should be the last
// statement to the stack. If there is anything left
// on the stack, an error in parsing has occurred.
if k.Kind != ASTKindStart {
stack.MarkComplete(k)
}
break loop
case SkipTokenState:
// When skipping a token, the previous state was popped off the stack.
// To maintain the correct state, the previous state will be pushed
// onto the stack.
stack.Push(k)
case StatementState:
if k.Kind != ASTKindStart {
stack.MarkComplete(k)
}
expr := newExpression(tok)
stack.Push(expr)
case StatementPrimeState:
if tok.Type() != TokenOp {
stack.MarkComplete(k)
continue
}
if k.Kind != ASTKindExpr {
return nil, NewParseError(
fmt.Sprintf("invalid expression: expected Expr type, but found %T type", k),
)
}
k = trimSpaces(k)
expr := newEqualExpr(k, tok)
stack.Push(expr)
case ValueState:
// ValueState requires the previous state to either be an equal expression
// or an expression statement.
//
// This grammar occurs when the RHS is a number, word, or quoted string.
// equal_expr -> lit op equal_expr'
// equal_expr' -> number | string | quoted_string
// quoted_string -> " quoted_string'
// quoted_string' -> string quoted_string_end
// quoted_string_end -> "
//
// otherwise
// expr_stmt -> equal_expr (expr_stmt')*
// expr_stmt' -> ws S | op S | MarkComplete
// S -> equal_expr' expr_stmt'
switch k.Kind {
case ASTKindEqualExpr:
// assiging a value to some key
k.AppendChild(newExpression(tok))
stack.Push(newExprStatement(k))
case ASTKindExpr:
k.Root.raw = append(k.Root.raw, tok.Raw()...)
stack.Push(k)
case ASTKindExprStatement:
root := k.GetRoot()
children := root.GetChildren()
if len(children) == 0 {
return nil, NewParseError(
fmt.Sprintf("invalid expression: AST contains no children %s", k.Kind),
)
}
rhs := children[len(children)-1]
if rhs.Root.ValueType != QuotedStringType {
rhs.Root.ValueType = StringType
rhs.Root.raw = append(rhs.Root.raw, tok.Raw()...)
}
children[len(children)-1] = rhs
k.SetChildren(children)
stack.Push(k)
}
case OpenScopeState:
if !runeCompare(tok.Raw(), openBrace) {
return nil, NewParseError("expected '['")
}
stmt := newStatement()
stack.Push(stmt)
case CloseScopeState:
if !runeCompare(tok.Raw(), closeBrace) {
return nil, NewParseError("expected ']'")
}
k = trimSpaces(k)
stack.Push(newCompletedSectionStatement(k))
case SectionState:
var stmt AST
switch k.Kind {
case ASTKindStatement:
// If there are multiple literals inside of a scope declaration,
// then the current token's raw value will be appended to the Name.
//
// This handles cases like [ profile default ]
//
// k will represent a SectionStatement with the children representing
// the label of the section
stmt = newSectionStatement(tok)
case ASTKindSectionStatement:
k.Root.raw = append(k.Root.raw, tok.Raw()...)
stmt = k
default:
return nil, NewParseError(
fmt.Sprintf("invalid statement: expected statement: %v", k.Kind),
)
}
stack.Push(stmt)
case MarkCompleteState:
if k.Kind != ASTKindStart {
stack.MarkComplete(k)
}
if stack.Len() == 0 {
stack.Push(start)
}
case SkipState:
stack.Push(newSkipStatement(k))
s.Skip()
case CommentState:
if k.Kind == ASTKindStart {
stack.Push(k)
} else {
stack.MarkComplete(k)
}
stmt := newCommentStatement(tok)
stack.Push(stmt)
default:
return nil, NewParseError(fmt.Sprintf("invalid state with ASTKind %v and TokenType %v", k, tok))
}
if len(tokens) > 0 {
tokens = tokens[1:]
}
}
// this occurs when a statement has not been completed
if stack.top > 1 {
return nil, NewParseError(fmt.Sprintf("incomplete expression: %v", stack.container))
}
// returns a sublist which exludes the start symbol
return stack.List(), nil
}
// trimSpaces will trim spaces on the left and right hand side of
// the literal.
func trimSpaces(k AST) AST {
// trim left hand side of spaces
for i := 0; i < len(k.Root.raw); i++ {
if !isWhitespace(k.Root.raw[i]) {
break
}
k.Root.raw = k.Root.raw[1:]
i--
}
// trim right hand side of spaces
for i := len(k.Root.raw) - 1; i >= 0; i-- {
if !isWhitespace(k.Root.raw[i]) {
break
}
k.Root.raw = k.Root.raw[:len(k.Root.raw)-1]
}
return k
}

View File

@ -0,0 +1,324 @@
package ini
import (
"fmt"
"strconv"
"strings"
)
var (
runesTrue = []rune("true")
runesFalse = []rune("false")
)
var literalValues = [][]rune{
runesTrue,
runesFalse,
}
func isBoolValue(b []rune) bool {
for _, lv := range literalValues {
if isLitValue(lv, b) {
return true
}
}
return false
}
func isLitValue(want, have []rune) bool {
if len(have) < len(want) {
return false
}
for i := 0; i < len(want); i++ {
if want[i] != have[i] {
return false
}
}
return true
}
// isNumberValue will return whether not the leading characters in
// a byte slice is a number. A number is delimited by whitespace or
// the newline token.
//
// A number is defined to be in a binary, octal, decimal (int | float), hex format,
// or in scientific notation.
func isNumberValue(b []rune) bool {
negativeIndex := 0
helper := numberHelper{}
needDigit := false
for i := 0; i < len(b); i++ {
negativeIndex++
switch b[i] {
case '-':
if helper.IsNegative() || negativeIndex != 1 {
return false
}
helper.Determine(b[i])
needDigit = true
continue
case 'e', 'E':
if err := helper.Determine(b[i]); err != nil {
return false
}
negativeIndex = 0
needDigit = true
continue
case 'b':
if helper.numberFormat == hex {
break
}
fallthrough
case 'o', 'x':
needDigit = true
if i == 0 {
return false
}
fallthrough
case '.':
if err := helper.Determine(b[i]); err != nil {
return false
}
needDigit = true
continue
}
if i > 0 && (isNewline(b[i:]) || isWhitespace(b[i])) {
return !needDigit
}
if !helper.CorrectByte(b[i]) {
return false
}
needDigit = false
}
return !needDigit
}
func isValid(b []rune) (bool, int, error) {
if len(b) == 0 {
// TODO: should probably return an error
return false, 0, nil
}
return isValidRune(b[0]), 1, nil
}
func isValidRune(r rune) bool {
return r != ':' && r != '=' && r != '[' && r != ']' && r != ' ' && r != '\n'
}
// ValueType is an enum that will signify what type
// the Value is
type ValueType int
func (v ValueType) String() string {
switch v {
case NoneType:
return "NONE"
case DecimalType:
return "FLOAT"
case IntegerType:
return "INT"
case StringType:
return "STRING"
case BoolType:
return "BOOL"
}
return ""
}
// ValueType enums
const (
NoneType = ValueType(iota)
DecimalType
IntegerType
StringType
QuotedStringType
BoolType
)
// Value is a union container
type Value struct {
Type ValueType
raw []rune
integer int64
decimal float64
boolean bool
str string
}
func newValue(t ValueType, base int, raw []rune) (Value, error) {
v := Value{
Type: t,
raw: raw,
}
var err error
switch t {
case DecimalType:
v.decimal, err = strconv.ParseFloat(string(raw), 64)
case IntegerType:
if base != 10 {
raw = raw[2:]
}
v.integer, err = strconv.ParseInt(string(raw), base, 64)
case StringType:
v.str = string(raw)
case QuotedStringType:
v.str = string(raw[1 : len(raw)-1])
case BoolType:
v.boolean = runeCompare(v.raw, runesTrue)
}
// issue 2253
//
// if the value trying to be parsed is too large, then we will use
// the 'StringType' and raw value instead.
if nerr, ok := err.(*strconv.NumError); ok && nerr.Err == strconv.ErrRange {
v.Type = StringType
v.str = string(raw)
err = nil
}
return v, err
}
// Append will append values and change the type to a string
// type.
func (v *Value) Append(tok Token) {
r := tok.Raw()
if v.Type != QuotedStringType {
v.Type = StringType
r = tok.raw[1 : len(tok.raw)-1]
}
if tok.Type() != TokenLit {
v.raw = append(v.raw, tok.Raw()...)
} else {
v.raw = append(v.raw, r...)
}
}
func (v Value) String() string {
switch v.Type {
case DecimalType:
return fmt.Sprintf("decimal: %f", v.decimal)
case IntegerType:
return fmt.Sprintf("integer: %d", v.integer)
case StringType:
return fmt.Sprintf("string: %s", string(v.raw))
case QuotedStringType:
return fmt.Sprintf("quoted string: %s", string(v.raw))
case BoolType:
return fmt.Sprintf("bool: %t", v.boolean)
default:
return "union not set"
}
}
func newLitToken(b []rune) (Token, int, error) {
n := 0
var err error
token := Token{}
if b[0] == '"' {
n, err = getStringValue(b)
if err != nil {
return token, n, err
}
token = newToken(TokenLit, b[:n], QuotedStringType)
} else if isNumberValue(b) {
var base int
base, n, err = getNumericalValue(b)
if err != nil {
return token, 0, err
}
value := b[:n]
vType := IntegerType
if contains(value, '.') || hasExponent(value) {
vType = DecimalType
}
token = newToken(TokenLit, value, vType)
token.base = base
} else if isBoolValue(b) {
n, err = getBoolValue(b)
token = newToken(TokenLit, b[:n], BoolType)
} else {
n, err = getValue(b)
token = newToken(TokenLit, b[:n], StringType)
}
return token, n, err
}
// IntValue returns an integer value
func (v Value) IntValue() int64 {
return v.integer
}
// FloatValue returns a float value
func (v Value) FloatValue() float64 {
return v.decimal
}
// BoolValue returns a bool value
func (v Value) BoolValue() bool {
return v.boolean
}
func isTrimmable(r rune) bool {
switch r {
case '\n', ' ':
return true
}
return false
}
// StringValue returns the string value
func (v Value) StringValue() string {
switch v.Type {
case StringType:
return strings.TrimFunc(string(v.raw), isTrimmable)
case QuotedStringType:
// preserve all characters in the quotes
return string(removeEscapedCharacters(v.raw[1 : len(v.raw)-1]))
default:
return strings.TrimFunc(string(v.raw), isTrimmable)
}
}
func contains(runes []rune, c rune) bool {
for i := 0; i < len(runes); i++ {
if runes[i] == c {
return true
}
}
return false
}
func runeCompare(v1 []rune, v2 []rune) bool {
if len(v1) != len(v2) {
return false
}
for i := 0; i < len(v1); i++ {
if v1[i] != v2[i] {
return false
}
}
return true
}

View File

@ -0,0 +1,30 @@
package ini
func isNewline(b []rune) bool {
if len(b) == 0 {
return false
}
if b[0] == '\n' {
return true
}
if len(b) < 2 {
return false
}
return b[0] == '\r' && b[1] == '\n'
}
func newNewlineToken(b []rune) (Token, int, error) {
i := 1
if b[0] == '\r' && isNewline(b[1:]) {
i++
}
if !isNewline([]rune(b[:i])) {
return emptyToken, 0, NewParseError("invalid new line token")
}
return newToken(TokenNL, b[:i], NoneType), i, nil
}

View File

@ -0,0 +1,152 @@
package ini
import (
"bytes"
"fmt"
"strconv"
)
const (
none = numberFormat(iota)
binary
octal
decimal
hex
exponent
)
type numberFormat int
// numberHelper is used to dictate what format a number is in
// and what to do for negative values. Since -1e-4 is a valid
// number, we cannot just simply check for duplicate negatives.
type numberHelper struct {
numberFormat numberFormat
negative bool
negativeExponent bool
}
func (b numberHelper) Exists() bool {
return b.numberFormat != none
}
func (b numberHelper) IsNegative() bool {
return b.negative || b.negativeExponent
}
func (b *numberHelper) Determine(c rune) error {
if b.Exists() {
return NewParseError(fmt.Sprintf("multiple number formats: 0%v", string(c)))
}
switch c {
case 'b':
b.numberFormat = binary
case 'o':
b.numberFormat = octal
case 'x':
b.numberFormat = hex
case 'e', 'E':
b.numberFormat = exponent
case '-':
if b.numberFormat != exponent {
b.negative = true
} else {
b.negativeExponent = true
}
case '.':
b.numberFormat = decimal
default:
return NewParseError(fmt.Sprintf("invalid number character: %v", string(c)))
}
return nil
}
func (b numberHelper) CorrectByte(c rune) bool {
switch {
case b.numberFormat == binary:
if !isBinaryByte(c) {
return false
}
case b.numberFormat == octal:
if !isOctalByte(c) {
return false
}
case b.numberFormat == hex:
if !isHexByte(c) {
return false
}
case b.numberFormat == decimal:
if !isDigit(c) {
return false
}
case b.numberFormat == exponent:
if !isDigit(c) {
return false
}
case b.negativeExponent:
if !isDigit(c) {
return false
}
case b.negative:
if !isDigit(c) {
return false
}
default:
if !isDigit(c) {
return false
}
}
return true
}
func (b numberHelper) Base() int {
switch b.numberFormat {
case binary:
return 2
case octal:
return 8
case hex:
return 16
default:
return 10
}
}
func (b numberHelper) String() string {
buf := bytes.Buffer{}
i := 0
switch b.numberFormat {
case binary:
i++
buf.WriteString(strconv.Itoa(i) + ": binary format\n")
case octal:
i++
buf.WriteString(strconv.Itoa(i) + ": octal format\n")
case hex:
i++
buf.WriteString(strconv.Itoa(i) + ": hex format\n")
case exponent:
i++
buf.WriteString(strconv.Itoa(i) + ": exponent format\n")
default:
i++
buf.WriteString(strconv.Itoa(i) + ": integer format\n")
}
if b.negative {
i++
buf.WriteString(strconv.Itoa(i) + ": negative format\n")
}
if b.negativeExponent {
i++
buf.WriteString(strconv.Itoa(i) + ": negative exponent format\n")
}
return buf.String()
}

View File

@ -0,0 +1,39 @@
package ini
import (
"fmt"
)
var (
equalOp = []rune("=")
equalColonOp = []rune(":")
)
func isOp(b []rune) bool {
if len(b) == 0 {
return false
}
switch b[0] {
case '=':
return true
case ':':
return true
default:
return false
}
}
func newOpToken(b []rune) (Token, int, error) {
tok := Token{}
switch b[0] {
case '=':
tok = newToken(TokenOp, equalOp, NoneType)
case ':':
tok = newToken(TokenOp, equalColonOp, NoneType)
default:
return tok, 0, NewParseError(fmt.Sprintf("unexpected op type, %v", b[0]))
}
return tok, 1, nil
}

View File

@ -0,0 +1,43 @@
package ini
import "fmt"
const (
// ErrCodeParseError is returned when a parsing error
// has occurred.
ErrCodeParseError = "INIParseError"
)
// ParseError is an error which is returned during any part of
// the parsing process.
type ParseError struct {
msg string
}
// NewParseError will return a new ParseError where message
// is the description of the error.
func NewParseError(message string) *ParseError {
return &ParseError{
msg: message,
}
}
// Code will return the ErrCodeParseError
func (err *ParseError) Code() string {
return ErrCodeParseError
}
// Message returns the error's message
func (err *ParseError) Message() string {
return err.msg
}
// OrigError return nothing since there will never be any
// original error.
func (err *ParseError) OrigError() error {
return nil
}
func (err *ParseError) Error() string {
return fmt.Sprintf("%s: %s", err.Code(), err.Message())
}

View File

@ -0,0 +1,60 @@
package ini
import (
"bytes"
"fmt"
)
// ParseStack is a stack that contains a container, the stack portion,
// and the list which is the list of ASTs that have been successfully
// parsed.
type ParseStack struct {
top int
container []AST
list []AST
index int
}
func newParseStack(sizeContainer, sizeList int) ParseStack {
return ParseStack{
container: make([]AST, sizeContainer),
list: make([]AST, sizeList),
}
}
// Pop will return and truncate the last container element.
func (s *ParseStack) Pop() AST {
s.top--
return s.container[s.top]
}
// Push will add the new AST to the container
func (s *ParseStack) Push(ast AST) {
s.container[s.top] = ast
s.top++
}
// MarkComplete will append the AST to the list of completed statements
func (s *ParseStack) MarkComplete(ast AST) {
s.list[s.index] = ast
s.index++
}
// List will return the completed statements
func (s ParseStack) List() []AST {
return s.list[:s.index]
}
// Len will return the length of the container
func (s *ParseStack) Len() int {
return s.top
}
func (s ParseStack) String() string {
buf := bytes.Buffer{}
for i, node := range s.list {
buf.WriteString(fmt.Sprintf("%d: %v\n", i+1, node))
}
return buf.String()
}

View File

@ -0,0 +1,41 @@
package ini
import (
"fmt"
)
var (
emptyRunes = []rune{}
)
func isSep(b []rune) bool {
if len(b) == 0 {
return false
}
switch b[0] {
case '[', ']':
return true
default:
return false
}
}
var (
openBrace = []rune("[")
closeBrace = []rune("]")
)
func newSepToken(b []rune) (Token, int, error) {
tok := Token{}
switch b[0] {
case '[':
tok = newToken(TokenSep, openBrace, NoneType)
case ']':
tok = newToken(TokenSep, closeBrace, NoneType)
default:
return tok, 0, NewParseError(fmt.Sprintf("unexpected sep type, %v", b[0]))
}
return tok, 1, nil
}

View File

@ -0,0 +1,45 @@
package ini
// skipper is used to skip certain blocks of an ini file.
// Currently skipper is used to skip nested blocks of ini
// files. See example below
//
// [ foo ]
// nested = ; this section will be skipped
// a=b
// c=d
// bar=baz ; this will be included
type skipper struct {
shouldSkip bool
TokenSet bool
prevTok Token
}
func newSkipper() skipper {
return skipper{
prevTok: emptyToken,
}
}
func (s *skipper) ShouldSkip(tok Token) bool {
if s.shouldSkip &&
s.prevTok.Type() == TokenNL &&
tok.Type() != TokenWS {
s.Continue()
return false
}
s.prevTok = tok
return s.shouldSkip
}
func (s *skipper) Skip() {
s.shouldSkip = true
s.prevTok = emptyToken
}
func (s *skipper) Continue() {
s.shouldSkip = false
s.prevTok = emptyToken
}

View File

@ -0,0 +1,35 @@
package ini
// Statement is an empty AST mostly used for transitioning states.
func newStatement() AST {
return newAST(ASTKindStatement, AST{})
}
// SectionStatement represents a section AST
func newSectionStatement(tok Token) AST {
return newASTWithRootToken(ASTKindSectionStatement, tok)
}
// ExprStatement represents a completed expression AST
func newExprStatement(ast AST) AST {
return newAST(ASTKindExprStatement, ast)
}
// CommentStatement represents a comment in the ini defintion.
//
// grammar:
// comment -> #comment' | ;comment'
// comment' -> epsilon | value
func newCommentStatement(tok Token) AST {
return newAST(ASTKindCommentStatement, newExpression(tok))
}
// CompletedSectionStatement represents a completed section
func newCompletedSectionStatement(ast AST) AST {
return newAST(ASTKindCompletedSectionStatement, ast)
}
// SkipStatement is used to skip whole statements
func newSkipStatement(ast AST) AST {
return newAST(ASTKindSkipStatement, ast)
}

View File

@ -0,0 +1,284 @@
package ini
import (
"fmt"
)
// getStringValue will return a quoted string and the amount
// of bytes read
//
// an error will be returned if the string is not properly formatted
func getStringValue(b []rune) (int, error) {
if b[0] != '"' {
return 0, NewParseError("strings must start with '\"'")
}
endQuote := false
i := 1
for ; i < len(b) && !endQuote; i++ {
if escaped := isEscaped(b[:i], b[i]); b[i] == '"' && !escaped {
endQuote = true
break
} else if escaped {
/*c, err := getEscapedByte(b[i])
if err != nil {
return 0, err
}
b[i-1] = c
b = append(b[:i], b[i+1:]...)
i--*/
continue
}
}
if !endQuote {
return 0, NewParseError("missing '\"' in string value")
}
return i + 1, nil
}
// getBoolValue will return a boolean and the amount
// of bytes read
//
// an error will be returned if the boolean is not of a correct
// value
func getBoolValue(b []rune) (int, error) {
if len(b) < 4 {
return 0, NewParseError("invalid boolean value")
}
n := 0
for _, lv := range literalValues {
if len(lv) > len(b) {
continue
}
if isLitValue(lv, b) {
n = len(lv)
}
}
if n == 0 {
return 0, NewParseError("invalid boolean value")
}
return n, nil
}
// getNumericalValue will return a numerical string, the amount
// of bytes read, and the base of the number
//
// an error will be returned if the number is not of a correct
// value
func getNumericalValue(b []rune) (int, int, error) {
if !isDigit(b[0]) {
return 0, 0, NewParseError("invalid digit value")
}
i := 0
helper := numberHelper{}
loop:
for negativeIndex := 0; i < len(b); i++ {
negativeIndex++
if !isDigit(b[i]) {
switch b[i] {
case '-':
if helper.IsNegative() || negativeIndex != 1 {
return 0, 0, NewParseError("parse error '-'")
}
n := getNegativeNumber(b[i:])
i += (n - 1)
helper.Determine(b[i])
continue
case '.':
if err := helper.Determine(b[i]); err != nil {
return 0, 0, err
}
case 'e', 'E':
if err := helper.Determine(b[i]); err != nil {
return 0, 0, err
}
negativeIndex = 0
case 'b':
if helper.numberFormat == hex {
break
}
fallthrough
case 'o', 'x':
if i == 0 && b[i] != '0' {
return 0, 0, NewParseError("incorrect base format, expected leading '0'")
}
if i != 1 {
return 0, 0, NewParseError(fmt.Sprintf("incorrect base format found %s at %d index", string(b[i]), i))
}
if err := helper.Determine(b[i]); err != nil {
return 0, 0, err
}
default:
if isWhitespace(b[i]) {
break loop
}
if isNewline(b[i:]) {
break loop
}
if !(helper.numberFormat == hex && isHexByte(b[i])) {
if i+2 < len(b) && !isNewline(b[i:i+2]) {
return 0, 0, NewParseError("invalid numerical character")
} else if !isNewline([]rune{b[i]}) {
return 0, 0, NewParseError("invalid numerical character")
}
break loop
}
}
}
}
return helper.Base(), i, nil
}
// isDigit will return whether or not something is an integer
func isDigit(b rune) bool {
return b >= '0' && b <= '9'
}
func hasExponent(v []rune) bool {
return contains(v, 'e') || contains(v, 'E')
}
func isBinaryByte(b rune) bool {
switch b {
case '0', '1':
return true
default:
return false
}
}
func isOctalByte(b rune) bool {
switch b {
case '0', '1', '2', '3', '4', '5', '6', '7':
return true
default:
return false
}
}
func isHexByte(b rune) bool {
if isDigit(b) {
return true
}
return (b >= 'A' && b <= 'F') ||
(b >= 'a' && b <= 'f')
}
func getValue(b []rune) (int, error) {
i := 0
for i < len(b) {
if isNewline(b[i:]) {
break
}
if isOp(b[i:]) {
break
}
valid, n, err := isValid(b[i:])
if err != nil {
return 0, err
}
if !valid {
break
}
i += n
}
return i, nil
}
// getNegativeNumber will return a negative number from a
// byte slice. This will iterate through all characters until
// a non-digit has been found.
func getNegativeNumber(b []rune) int {
if b[0] != '-' {
return 0
}
i := 1
for ; i < len(b); i++ {
if !isDigit(b[i]) {
return i
}
}
return i
}
// isEscaped will return whether or not the character is an escaped
// character.
func isEscaped(value []rune, b rune) bool {
if len(value) == 0 {
return false
}
switch b {
case '\'': // single quote
case '"': // quote
case 'n': // newline
case 't': // tab
case '\\': // backslash
default:
return false
}
return value[len(value)-1] == '\\'
}
func getEscapedByte(b rune) (rune, error) {
switch b {
case '\'': // single quote
return '\'', nil
case '"': // quote
return '"', nil
case 'n': // newline
return '\n', nil
case 't': // table
return '\t', nil
case '\\': // backslash
return '\\', nil
default:
return b, NewParseError(fmt.Sprintf("invalid escaped character %c", b))
}
}
func removeEscapedCharacters(b []rune) []rune {
for i := 0; i < len(b); i++ {
if isEscaped(b[:i], b[i]) {
c, err := getEscapedByte(b[i])
if err != nil {
return b
}
b[i-1] = c
b = append(b[:i], b[i+1:]...)
i--
}
}
return b
}

View File

@ -0,0 +1,166 @@
package ini
import (
"fmt"
"sort"
)
// Visitor is an interface used by walkers that will
// traverse an array of ASTs.
type Visitor interface {
VisitExpr(AST) error
VisitStatement(AST) error
}
// DefaultVisitor is used to visit statements and expressions
// and ensure that they are both of the correct format.
// In addition, upon visiting this will build sections and populate
// the Sections field which can be used to retrieve profile
// configuration.
type DefaultVisitor struct {
scope string
Sections Sections
}
// NewDefaultVisitor return a DefaultVisitor
func NewDefaultVisitor() *DefaultVisitor {
return &DefaultVisitor{
Sections: Sections{
container: map[string]Section{},
},
}
}
// VisitExpr visits expressions...
func (v *DefaultVisitor) VisitExpr(expr AST) error {
t := v.Sections.container[v.scope]
if t.values == nil {
t.values = values{}
}
switch expr.Kind {
case ASTKindExprStatement:
opExpr := expr.GetRoot()
switch opExpr.Kind {
case ASTKindEqualExpr:
children := opExpr.GetChildren()
if len(children) <= 1 {
return NewParseError("unexpected token type")
}
rhs := children[1]
if rhs.Root.Type() != TokenLit {
return NewParseError("unexpected token type")
}
key := EqualExprKey(opExpr)
v, err := newValue(rhs.Root.ValueType, rhs.Root.base, rhs.Root.Raw())
if err != nil {
return err
}
t.values[key] = v
default:
return NewParseError(fmt.Sprintf("unsupported expression %v", expr))
}
default:
return NewParseError(fmt.Sprintf("unsupported expression %v", expr))
}
v.Sections.container[v.scope] = t
return nil
}
// VisitStatement visits statements...
func (v *DefaultVisitor) VisitStatement(stmt AST) error {
switch stmt.Kind {
case ASTKindCompletedSectionStatement:
child := stmt.GetRoot()
if child.Kind != ASTKindSectionStatement {
return NewParseError(fmt.Sprintf("unsupported child statement: %T", child))
}
name := string(child.Root.Raw())
v.Sections.container[name] = Section{}
v.scope = name
default:
return NewParseError(fmt.Sprintf("unsupported statement: %s", stmt.Kind))
}
return nil
}
// Sections is a map of Section structures that represent
// a configuration.
type Sections struct {
container map[string]Section
}
// GetSection will return section p. If section p does not exist,
// false will be returned in the second parameter.
func (t Sections) GetSection(p string) (Section, bool) {
v, ok := t.container[p]
return v, ok
}
// values represents a map of union values.
type values map[string]Value
// List will return a list of all sections that were successfully
// parsed.
func (t Sections) List() []string {
keys := make([]string, len(t.container))
i := 0
for k := range t.container {
keys[i] = k
i++
}
sort.Strings(keys)
return keys
}
// Section contains a name and values. This represent
// a sectioned entry in a configuration file.
type Section struct {
Name string
values values
}
// Has will return whether or not an entry exists in a given section
func (t Section) Has(k string) bool {
_, ok := t.values[k]
return ok
}
// ValueType will returned what type the union is set to. If
// k was not found, the NoneType will be returned.
func (t Section) ValueType(k string) (ValueType, bool) {
v, ok := t.values[k]
return v.Type, ok
}
// Bool returns a bool value at k
func (t Section) Bool(k string) bool {
return t.values[k].BoolValue()
}
// Int returns an integer value at k
func (t Section) Int(k string) int64 {
return t.values[k].IntValue()
}
// Float64 returns a float value at k
func (t Section) Float64(k string) float64 {
return t.values[k].FloatValue()
}
// String returns the string value at k
func (t Section) String(k string) string {
_, ok := t.values[k]
if !ok {
return ""
}
return t.values[k].StringValue()
}

View File

@ -0,0 +1,25 @@
package ini
// Walk will traverse the AST using the v, the Visitor.
func Walk(tree []AST, v Visitor) error {
for _, node := range tree {
switch node.Kind {
case ASTKindExpr,
ASTKindExprStatement:
if err := v.VisitExpr(node); err != nil {
return err
}
case ASTKindStatement,
ASTKindCompletedSectionStatement,
ASTKindNestedSectionStatement,
ASTKindCompletedNestedSectionStatement:
if err := v.VisitStatement(node); err != nil {
return err
}
}
}
return nil
}

View File

@ -0,0 +1,24 @@
package ini
import (
"unicode"
)
// isWhitespace will return whether or not the character is
// a whitespace character.
//
// Whitespace is defined as a space or tab.
func isWhitespace(c rune) bool {
return unicode.IsSpace(c) && c != '\n' && c != '\r'
}
func newWSToken(b []rune) (Token, int, error) {
i := 0
for ; i < len(b); i++ {
if !isWhitespace(b[i]) {
break
}
}
return newToken(TokenWS, b[:i], NoneType), i, nil
}

View File

@ -1,7 +1,54 @@
package protocol package protocol
// ValidHostLabel returns if the label is a valid RFC 1123 Section 2.1 domain import (
// host label name. "strings"
"github.com/aws/aws-sdk-go/aws/request"
)
// ValidateEndpointHostHandler is a request handler that will validate the
// request endpoint's hosts is a valid RFC 3986 host.
var ValidateEndpointHostHandler = request.NamedHandler{
Name: "awssdk.protocol.ValidateEndpointHostHandler",
Fn: func(r *request.Request) {
err := ValidateEndpointHost(r.Operation.Name, r.HTTPRequest.URL.Host)
if err != nil {
r.Error = err
}
},
}
// ValidateEndpointHost validates that the host string passed in is a valid RFC
// 3986 host. Returns error if the host is not valid.
func ValidateEndpointHost(opName, host string) error {
paramErrs := request.ErrInvalidParams{Context: opName}
labels := strings.Split(host, ".")
for i, label := range labels {
if i == len(labels)-1 && len(label) == 0 {
// Allow trailing dot for FQDN hosts.
continue
}
if !ValidHostLabel(label) {
paramErrs.Add(request.NewErrParamFormat(
"endpoint host label", "[a-zA-Z0-9-]{1,63}", label))
}
}
if len(host) > 255 {
paramErrs.Add(request.NewErrParamMaxLen(
"endpoint host", 255, host,
))
}
if paramErrs.Len() > 0 {
return paramErrs
}
return nil
}
// ValidHostLabel returns if the label is a valid RFC 3986 host label.
func ValidHostLabel(label string) bool { func ValidHostLabel(label string) bool {
if l := len(label); l == 0 || l > 63 { if l := len(label); l == 0 || l > 63 {
return false return false

View File

@ -0,0 +1,54 @@
package protocol
import (
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
// HostPrefixHandlerName is the handler name for the host prefix request
// handler.
const HostPrefixHandlerName = "awssdk.endpoint.HostPrefixHandler"
// NewHostPrefixHandler constructs a build handler
func NewHostPrefixHandler(prefix string, labelsFn func() map[string]string) request.NamedHandler {
builder := HostPrefixBuilder{
Prefix: prefix,
LabelsFn: labelsFn,
}
return request.NamedHandler{
Name: HostPrefixHandlerName,
Fn: builder.Build,
}
}
// HostPrefixBuilder provides the request handler to expand and prepend
// the host prefix into the operation's request endpoint host.
type HostPrefixBuilder struct {
Prefix string
LabelsFn func() map[string]string
}
// Build updates the passed in Request with the HostPrefix template expanded.
func (h HostPrefixBuilder) Build(r *request.Request) {
if aws.BoolValue(r.Config.DisableEndpointHostPrefix) {
return
}
var labels map[string]string
if h.LabelsFn != nil {
labels = h.LabelsFn()
}
prefix := h.Prefix
for name, value := range labels {
prefix = strings.Replace(prefix, "{"+name+"}", value, -1)
}
r.HTTPRequest.URL.Host = prefix + r.HTTPRequest.URL.Host
if len(r.HTTPRequest.Host) > 0 {
r.HTTPRequest.Host = prefix + r.HTTPRequest.Host
}
}

View File

@ -87,7 +87,7 @@ func (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag refle
} }
} }
// buildStruct adds a struct and its fields to the current XMLNode. All fields any any nested // buildStruct adds a struct and its fields to the current XMLNode. All fields and any nested
// types are converted to XMLNodes also. // types are converted to XMLNodes also.
func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
if !value.IsValid() { if !value.IsValid() {

View File

@ -52,8 +52,7 @@ func (c *ACM) AddTagsToCertificateRequest(input *AddTagsToCertificateInput) (req
output = &AddTagsToCertificateOutput{} output = &AddTagsToCertificateOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -160,8 +159,7 @@ func (c *ACM) DeleteCertificateRequest(input *DeleteCertificateInput) (req *requ
output = &DeleteCertificateOutput{} output = &DeleteCertificateOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -878,8 +876,7 @@ func (c *ACM) RemoveTagsFromCertificateRequest(input *RemoveTagsFromCertificateI
output = &RemoveTagsFromCertificateOutput{} output = &RemoveTagsFromCertificateOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1070,8 +1067,7 @@ func (c *ACM) ResendValidationEmailRequest(input *ResendValidationEmailInput) (r
output = &ResendValidationEmailOutput{} output = &ResendValidationEmailOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1171,8 +1167,7 @@ func (c *ACM) UpdateCertificateOptionsRequest(input *UpdateCertificateOptionsInp
output = &UpdateCertificateOptionsOutput{} output = &UpdateCertificateOptionsOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1979,7 +1974,7 @@ type ExportCertificateInput struct {
// Passphrase is automatically base64 encoded/decoded by the SDK. // Passphrase is automatically base64 encoded/decoded by the SDK.
// //
// Passphrase is a required field // Passphrase is a required field
Passphrase []byte `min:"4" type:"blob" required:"true"` Passphrase []byte `min:"4" type:"blob" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -2037,7 +2032,7 @@ type ExportCertificateOutput struct {
CertificateChain *string `min:"1" type:"string"` CertificateChain *string `min:"1" type:"string"`
// The PEM-encoded private key associated with the public key in the certificate. // The PEM-encoded private key associated with the public key in the certificate.
PrivateKey *string `min:"1" type:"string"` PrivateKey *string `min:"1" type:"string" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -2271,7 +2266,7 @@ type ImportCertificateInput struct {
// PrivateKey is automatically base64 encoded/decoded by the SDK. // PrivateKey is automatically base64 encoded/decoded by the SDK.
// //
// PrivateKey is a required field // PrivateKey is a required field
PrivateKey []byte `min:"1" type:"blob" required:"true"` PrivateKey []byte `min:"1" type:"blob" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation

View File

@ -246,8 +246,7 @@ func (c *ACMPCA) DeleteCertificateAuthorityRequest(input *DeleteCertificateAutho
output = &DeleteCertificateAuthorityOutput{} output = &DeleteCertificateAuthorityOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -833,8 +832,7 @@ func (c *ACMPCA) ImportCertificateAuthorityCertificateRequest(input *ImportCerti
output = &ImportCertificateAuthorityCertificateOutput{} output = &ImportCertificateAuthorityCertificateOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1223,8 +1221,7 @@ func (c *ACMPCA) RestoreCertificateAuthorityRequest(input *RestoreCertificateAut
output = &RestoreCertificateAuthorityOutput{} output = &RestoreCertificateAuthorityOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1324,8 +1321,7 @@ func (c *ACMPCA) RevokeCertificateRequest(input *RevokeCertificateInput) (req *r
output = &RevokeCertificateOutput{} output = &RevokeCertificateOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1430,8 +1426,7 @@ func (c *ACMPCA) TagCertificateAuthorityRequest(input *TagCertificateAuthorityIn
output = &TagCertificateAuthorityOutput{} output = &TagCertificateAuthorityOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1534,8 +1529,7 @@ func (c *ACMPCA) UntagCertificateAuthorityRequest(input *UntagCertificateAuthori
output = &UntagCertificateAuthorityOutput{} output = &UntagCertificateAuthorityOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1631,8 +1625,7 @@ func (c *ACMPCA) UpdateCertificateAuthorityRequest(input *UpdateCertificateAutho
output = &UpdateCertificateAuthorityOutput{} output = &UpdateCertificateAuthorityOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,8 @@ import (
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
) )
const opDeleteScalingPolicy = "DeleteScalingPolicy" const opDeleteScalingPolicy = "DeleteScalingPolicy"
@ -50,6 +52,7 @@ func (c *ApplicationAutoScaling) DeleteScalingPolicyRequest(input *DeleteScaling
output = &DeleteScalingPolicyOutput{} output = &DeleteScalingPolicyOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -150,6 +153,7 @@ func (c *ApplicationAutoScaling) DeleteScheduledActionRequest(input *DeleteSched
output = &DeleteScheduledActionOutput{} output = &DeleteScheduledActionOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -244,6 +248,7 @@ func (c *ApplicationAutoScaling) DeregisterScalableTargetRequest(input *Deregist
output = &DeregisterScalableTargetOutput{} output = &DeregisterScalableTargetOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1023,6 +1028,7 @@ func (c *ApplicationAutoScaling) PutScheduledActionRequest(input *PutScheduledAc
output = &PutScheduledActionOutput{} output = &PutScheduledActionOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1135,6 +1141,7 @@ func (c *ApplicationAutoScaling) RegisterScalableTargetRequest(input *RegisterSc
output = &RegisterScalableTargetOutput{} output = &RegisterScalableTargetOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }

5250
vendor/github.com/aws/aws-sdk-go/service/appmesh/api.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,44 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package appmesh provides the client and types for making API
// requests to AWS App Mesh.
//
// AWS App Mesh is a service mesh based on the Envoy proxy that makes it easy
// to monitor and control containerized microservices. App Mesh standardizes
// how your microservices communicate, giving you end-to-end visibility and
// helping to ensure high-availability for your applications.
//
// App Mesh gives you consistent visibility and network traffic controls for
// every microservice in an application. You can use App Mesh with Amazon ECS
// (using the Amazon EC2 launch type), Amazon EKS, and Kubernetes on AWS.
//
// App Mesh supports containerized microservice applications that use service
// discovery naming for their components. To use App Mesh, you must have a containerized
// application running on Amazon EC2 instances, hosted in either Amazon ECS,
// Amazon EKS, or Kubernetes on AWS. For more information about service discovery
// on Amazon ECS, see Service Discovery (http://docs.aws.amazon.com/AmazonECS/latest/developerguideservice-discovery.html)
// in the Amazon Elastic Container Service Developer Guide. Kubernetes kube-dns
// is supported. For more information, see DNS for Services and Pods (https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/)
// in the Kubernetes documentation.
//
// See https://docs.aws.amazon.com/goto/WebAPI/appmesh-2018-10-01 for more information on this service.
//
// See appmesh package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/appmesh/
//
// Using the Client
//
// To contact AWS App Mesh with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
//
// See the SDK's documentation for more information on how to use the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the AWS App Mesh client AppMesh for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/appmesh/#New
package appmesh

View File

@ -0,0 +1,69 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package appmesh
const (
// ErrCodeBadRequestException for service response error code
// "BadRequestException".
//
// The request syntax was malformed. Check your request syntax and try again.
ErrCodeBadRequestException = "BadRequestException"
// ErrCodeConflictException for service response error code
// "ConflictException".
//
// The request contains a client token that was used for a previous update resource
// call with different specifications. Try the request again with a new client
// token.
ErrCodeConflictException = "ConflictException"
// ErrCodeForbiddenException for service response error code
// "ForbiddenException".
//
// You do not have permissions to perform this action.
ErrCodeForbiddenException = "ForbiddenException"
// ErrCodeInternalServerErrorException for service response error code
// "InternalServerErrorException".
//
// The request processing has failed because of an unknown error, exception,
// or failure.
ErrCodeInternalServerErrorException = "InternalServerErrorException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// You have exceeded a service limit for your account. For more information,
// see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html)
// in the AWS App Mesh User Guide.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeNotFoundException for service response error code
// "NotFoundException".
//
// The specified resource does not exist. Check your request syntax and try
// again.
ErrCodeNotFoundException = "NotFoundException"
// ErrCodeResourceInUseException for service response error code
// "ResourceInUseException".
//
// You cannot delete the specified resource because it is in use or required
// by another resource.
ErrCodeResourceInUseException = "ResourceInUseException"
// ErrCodeServiceUnavailableException for service response error code
// "ServiceUnavailableException".
//
// The request has failed due to a temporary failure of the service.
ErrCodeServiceUnavailableException = "ServiceUnavailableException"
// ErrCodeTooManyRequestsException for service response error code
// "TooManyRequestsException".
//
// The maximum request rate permitted by the App Mesh APIs has been exceeded
// for your account. For best results, use an increasing or variable sleep interval
// between requests.
ErrCodeTooManyRequestsException = "TooManyRequestsException"
)

View File

@ -0,0 +1,99 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package appmesh
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/aws/aws-sdk-go/private/protocol/restjson"
)
// AppMesh provides the API operation methods for making requests to
// AWS App Mesh. See this package's package overview docs
// for details on the service.
//
// AppMesh methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type AppMesh struct {
*client.Client
}
// Used for custom client initialization logic
var initClient func(*client.Client)
// Used for custom request initialization logic
var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "App Mesh" // Name of service.
EndpointsID = "appmesh" // ID to lookup a service endpoint with.
ServiceID = "App Mesh" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the AppMesh client with a session.
// If additional configuration is needed for the client instance use the optional
// aws.Config parameter to add your extra config.
//
// Example:
// // Create a AppMesh client from just a session.
// svc := appmesh.New(mySession)
//
// // Create a AppMesh client with additional configuration
// svc := appmesh.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *AppMesh {
c := p.ClientConfig(EndpointsID, cfgs...)
if c.SigningNameDerived || len(c.SigningName) == 0 {
c.SigningName = "appmesh"
}
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *AppMesh {
svc := &AppMesh{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2018-10-01",
JSONVersion: "1.1",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a AppMesh operation and runs any
// custom request initialization.
func (c *AppMesh) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
// Run custom request initialization if present
if initRequest != nil {
initRequest(req)
}
return req
}

File diff suppressed because it is too large Load Diff

View File

@ -27,13 +27,13 @@ const (
// "BadRequestException". // "BadRequestException".
// //
// The request is not well formed. For example, a value is invalid or a required // The request is not well formed. For example, a value is invalid or a required
// field is missing. Check the field values, and try again. // field is missing. Check the field values, and then try again.
ErrCodeBadRequestException = "BadRequestException" ErrCodeBadRequestException = "BadRequestException"
// ErrCodeConcurrentModificationException for service response error code // ErrCodeConcurrentModificationException for service response error code
// "ConcurrentModificationException". // "ConcurrentModificationException".
// //
// Another modification is being made. That modification must complete before // Another modification is in progress at this time and it must complete before
// you can make your change. // you can make your change.
ErrCodeConcurrentModificationException = "ConcurrentModificationException" ErrCodeConcurrentModificationException = "ConcurrentModificationException"
@ -58,8 +58,8 @@ const (
// ErrCodeNotFoundException for service response error code // ErrCodeNotFoundException for service response error code
// "NotFoundException". // "NotFoundException".
// //
// The resource specified in the request was not found. Check the resource and // The resource specified in the request was not found. Check the resource,
// try again. // and then try again.
ErrCodeNotFoundException = "NotFoundException" ErrCodeNotFoundException = "NotFoundException"
// ErrCodeUnauthorizedException for service response error code // ErrCodeUnauthorizedException for service response error code

View File

@ -8,6 +8,8 @@ import (
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
) )
const opBatchGetNamedQuery = "BatchGetNamedQuery" const opBatchGetNamedQuery = "BatchGetNamedQuery"
@ -315,6 +317,7 @@ func (c *Athena) DeleteNamedQueryRequest(input *DeleteNamedQueryInput) (req *req
output = &DeleteNamedQueryOutput{} output = &DeleteNamedQueryOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1094,6 +1097,7 @@ func (c *Athena) StopQueryExecutionRequest(input *StopQueryExecutionInput) (req
output = &StopQueryExecutionOutput{} output = &StopQueryExecutionOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,10 @@
// //
// Amazon EC2 Auto Scaling is designed to automatically launch or terminate // Amazon EC2 Auto Scaling is designed to automatically launch or terminate
// EC2 instances based on user-defined policies, schedules, and health checks. // EC2 instances based on user-defined policies, schedules, and health checks.
// Use this service in conjunction with the AWS Auto Scaling, Amazon CloudWatch, // Use this service with AWS Auto Scaling, Amazon CloudWatch, and Elastic Load
// and Elastic Load Balancing services. // Balancing.
//
// For more information, see the Amazon EC2 Auto Scaling User Guide (http://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html).
// //
// See https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01 for more information on this service. // See https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01 for more information on this service.
// //

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,33 +3,39 @@
// Package budgets provides the client and types for making API // Package budgets provides the client and types for making API
// requests to AWS Budgets. // requests to AWS Budgets.
// //
// Budgets enable you to plan your service usage, service costs, and your RI // The AWS Budgets API enables you to use AWS Budgets to plan your service usage,
// utilization. You can also track how close your plan is to your budgeted amount // service costs, and instance reservations. The API reference provides descriptions,
// or to the free tier limits. Budgets provide you with a quick way to see your // syntax, and usage examples for each of the actions and data types for AWS
// usage-to-date and current estimated charges from AWS and to see how much // Budgets.
// your predicted usage accrues in charges by the end of the month. Budgets
// also compare current estimates and charges to the amount that you indicated
// you want to use or spend and lets you see how much of your budget has been
// used. AWS updates your budget status several times a day. Budgets track your
// unblended costs, subscriptions, and refunds. You can create the following
// types of budgets:
// //
// * Cost budgets allow you to say how much you want to spend on a service. // Budgets provide you with a way to see the following information:
// //
// * Usage budgets allow you to say how many hours you want to use for one // * How close your plan is to your budgeted amount or to the free tier limits
// or more services.
// //
// * RI utilization budgets allow you to define a utilization threshold and // * Your usage-to-date, including how much you've used of your Reserved
// receive alerts when RIs are tracking below that threshold. // Instances (RIs)
// //
// You can create up to 20,000 budgets per AWS master account. Your first two // * Your current estimated charges from AWS, and how much your predicted
// budgets are free of charge. Each additional budget costs $0.02 per day. You // usage will accrue in charges by the end of the month
// can set up optional notifications that warn you if you exceed, or are forecasted //
// to exceed, your budgeted amount. You can have notifications sent to an Amazon // * How much of your budget has been used
// SNS topic, to an email address, or to both. For more information, see Creating //
// an Amazon SNS Topic for Budget Notifications (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-sns-policy.html). // AWS updates your budget status several times a day. Budgets track your unblended
// AWS Free Tier usage alerts via AWS Budgets are provided for you, and do not // costs, subscriptions, refunds, and RIs. You can create the following types
// count toward your budget limits. // of budgets:
//
// * Cost budgets - Plan how much you want to spend on a service.
//
// * Usage budgets - Plan how much you want to use one or more services.
//
// * RI utilization budgets - Define a utilization threshold, and receive
// alerts when your RI usage falls below that threshold. This lets you see
// if your RIs are unused or under-utilized.
//
// * RI coverage budgets - Define a coverage threshold, and receive alerts
// when the number of your instance hours that are covered by RIs fall below
// that threshold. This lets you see how much of your instance usage is covered
// by a reservation.
// //
// Service Endpoint // Service Endpoint
// //
@ -37,8 +43,8 @@
// //
// * https://budgets.amazonaws.com // * https://budgets.amazonaws.com
// //
// For information about costs associated with the AWS Budgets API, see AWS // For information about costs that are associated with the AWS Budgets API,
// Cost Management Pricing (https://aws.amazon.com/aws-cost-management/pricing/). // see AWS Cost Management Pricing (https://aws.amazon.com/aws-cost-management/pricing/).
// //
// See budgets package documentation for more information. // See budgets package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/budgets/ // https://docs.aws.amazon.com/sdk-for-go/api/service/budgets/

View File

@ -8,6 +8,8 @@ import (
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
) )
const opCreateEnvironmentEC2 = "CreateEnvironmentEC2" const opCreateEnvironmentEC2 = "CreateEnvironmentEC2"
@ -245,6 +247,7 @@ func (c *Cloud9) DeleteEnvironmentRequest(input *DeleteEnvironmentInput) (req *r
output = &DeleteEnvironmentOutput{} output = &DeleteEnvironmentOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -343,6 +346,7 @@ func (c *Cloud9) DeleteEnvironmentMembershipRequest(input *DeleteEnvironmentMemb
output = &DeleteEnvironmentMembershipOutput{} output = &DeleteEnvironmentMembershipOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -941,6 +945,7 @@ func (c *Cloud9) UpdateEnvironmentRequest(input *UpdateEnvironmentInput) (req *r
output = &UpdateEnvironmentOutput{} output = &UpdateEnvironmentOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
// errors. For detailed information about CloudFront features, see the Amazon // errors. For detailed information about CloudFront features, see the Amazon
// CloudFront Developer Guide. // CloudFront Developer Guide.
// //
// See https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2018-06-18 for more information on this service. // See https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2018-11-05 for more information on this service.
// //
// See cloudfront package documentation for more information. // See cloudfront package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudfront/ // https://docs.aws.amazon.com/sdk-for-go/api/service/cloudfront/

View File

@ -425,6 +425,13 @@ const (
// "TooManyOriginCustomHeaders". // "TooManyOriginCustomHeaders".
ErrCodeTooManyOriginCustomHeaders = "TooManyOriginCustomHeaders" ErrCodeTooManyOriginCustomHeaders = "TooManyOriginCustomHeaders"
// ErrCodeTooManyOriginGroupsPerDistribution for service response error code
// "TooManyOriginGroupsPerDistribution".
//
// Processing your request would cause you to exceed the maximum number of origin
// groups allowed.
ErrCodeTooManyOriginGroupsPerDistribution = "TooManyOriginGroupsPerDistribution"
// ErrCodeTooManyOrigins for service response error code // ErrCodeTooManyOrigins for service response error code
// "TooManyOrigins". // "TooManyOrigins".
// //

View File

@ -60,7 +60,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
SigningName: signingName, SigningName: signingName,
SigningRegion: signingRegion, SigningRegion: signingRegion,
Endpoint: endpoint, Endpoint: endpoint,
APIVersion: "2018-06-18", APIVersion: "2018-11-05",
}, },
handlers, handlers,
), ),

View File

@ -9,6 +9,8 @@ import (
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
) )
const opCopyBackupToRegion = "CopyBackupToRegion" const opCopyBackupToRegion = "CopyBackupToRegion"
@ -1270,6 +1272,7 @@ func (c *CloudHSMV2) TagResourceRequest(input *TagResourceInput) (req *request.R
output = &TagResourceOutput{} output = &TagResourceOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1363,6 +1366,7 @@ func (c *CloudHSMV2) UntagResourceRequest(input *UntagResourceInput) (req *reque
output = &UntagResourceOutput{} output = &UntagResourceOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }

View File

@ -9,6 +9,8 @@ import (
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
) )
const opAddTags = "AddTags" const opAddTags = "AddTags"
@ -50,6 +52,7 @@ func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request,
output = &AddTagsOutput{} output = &AddTagsOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -113,6 +116,12 @@ func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request,
// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
// This exception is thrown when the requested operation is not permitted. // This exception is thrown when the requested operation is not permitted.
// //
// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
// This exception is thrown when the AWS account making the request to create
// or update an organization trail is not the master account for an organization
// in AWS Organizations. For more information, see Prepare For Creating a Trail
// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags
func (c *CloudTrail) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { func (c *CloudTrail) AddTags(input *AddTagsInput) (*AddTagsOutput, error) {
req, out := c.AddTagsRequest(input) req, out := c.AddTagsRequest(input)
@ -271,6 +280,35 @@ func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.R
// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
// This exception is thrown when the requested operation is not permitted. // This exception is thrown when the requested operation is not permitted.
// //
// * ErrCodeAccessNotEnabledException "CloudTrailAccessNotEnabledException"
// This exception is thrown when trusted access has not been enabled between
// AWS CloudTrail and AWS Organizations. For more information, see Enabling
// Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html)
// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
// This exception is thrown when the IAM user or role that is used to create
// the organization trail is lacking one or more required permissions for creating
// an organization trail in a required service. For more information, see Prepare
// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
// This exception is thrown when the AWS account making the request to create
// or update an organization trail is not the master account for an organization
// in AWS Organizations. For more information, see Prepare For Creating a Trail
// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeOrganizationsNotInUseException "OrganizationsNotInUseException"
// This exception is thrown when the request is made from an AWS account that
// is not a member of an organization. To make this request, sign in using the
// credentials of an account that belongs to an organization.
//
// * ErrCodeOrganizationNotInAllFeaturesModeException "OrganizationNotInAllFeaturesModeException"
// This exception is thrown when AWS Organizations is not configured to support
// all features. All features must be enabled in AWS Organization to support
// creating an organization trail. For more information, see Prepare For Creating
// a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail
func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error) { func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error) {
req, out := c.CreateTrailRequest(input) req, out := c.CreateTrailRequest(input)
@ -332,6 +370,7 @@ func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.R
output = &DeleteTrailOutput{} output = &DeleteTrailOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -372,6 +411,24 @@ func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.R
// This exception is thrown when an operation is called on a trail from a region // This exception is thrown when an operation is called on a trail from a region
// other than the region in which the trail was created. // other than the region in which the trail was created.
// //
// * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
// This exception is thrown when the requested operation is not supported.
//
// * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
// This exception is thrown when the requested operation is not permitted.
//
// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
// This exception is thrown when the AWS account making the request to create
// or update an organization trail is not the master account for an organization
// in AWS Organizations. For more information, see Prepare For Creating a Trail
// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
// This exception is thrown when the IAM user or role that is used to create
// the organization trail is lacking one or more required permissions for creating
// an organization trail in a required service. For more information, see Prepare
// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail
func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error) { func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error) {
req, out := c.DeleteTrailRequest(input) req, out := c.DeleteTrailRequest(input)
@ -1209,6 +1266,18 @@ func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (re
// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
// This exception is thrown when the requested operation is not permitted. // This exception is thrown when the requested operation is not permitted.
// //
// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
// This exception is thrown when the AWS account making the request to create
// or update an organization trail is not the master account for an organization
// in AWS Organizations. For more information, see Prepare For Creating a Trail
// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
// This exception is thrown when the IAM user or role that is used to create
// the organization trail is lacking one or more required permissions for creating
// an organization trail in a required service. For more information, see Prepare
// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors
func (c *CloudTrail) PutEventSelectors(input *PutEventSelectorsInput) (*PutEventSelectorsOutput, error) { func (c *CloudTrail) PutEventSelectors(input *PutEventSelectorsInput) (*PutEventSelectorsOutput, error) {
req, out := c.PutEventSelectorsRequest(input) req, out := c.PutEventSelectorsRequest(input)
@ -1270,6 +1339,7 @@ func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Req
output = &RemoveTagsOutput{} output = &RemoveTagsOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1324,6 +1394,12 @@ func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Req
// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
// This exception is thrown when the requested operation is not permitted. // This exception is thrown when the requested operation is not permitted.
// //
// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
// This exception is thrown when the AWS account making the request to create
// or update an organization trail is not the master account for an organization
// in AWS Organizations. For more information, see Prepare For Creating a Trail
// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags
func (c *CloudTrail) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { func (c *CloudTrail) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) {
req, out := c.RemoveTagsRequest(input) req, out := c.RemoveTagsRequest(input)
@ -1385,6 +1461,7 @@ func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request
output = &StartLoggingOutput{} output = &StartLoggingOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1427,6 +1504,24 @@ func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request
// This exception is thrown when an operation is called on a trail from a region // This exception is thrown when an operation is called on a trail from a region
// other than the region in which the trail was created. // other than the region in which the trail was created.
// //
// * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
// This exception is thrown when the requested operation is not supported.
//
// * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
// This exception is thrown when the requested operation is not permitted.
//
// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
// This exception is thrown when the AWS account making the request to create
// or update an organization trail is not the master account for an organization
// in AWS Organizations. For more information, see Prepare For Creating a Trail
// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
// This exception is thrown when the IAM user or role that is used to create
// the organization trail is lacking one or more required permissions for creating
// an organization trail in a required service. For more information, see Prepare
// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging
func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error) { func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error) {
req, out := c.StartLoggingRequest(input) req, out := c.StartLoggingRequest(input)
@ -1488,6 +1583,7 @@ func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.R
output = &StopLoggingOutput{} output = &StopLoggingOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1532,6 +1628,24 @@ func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.R
// This exception is thrown when an operation is called on a trail from a region // This exception is thrown when an operation is called on a trail from a region
// other than the region in which the trail was created. // other than the region in which the trail was created.
// //
// * ErrCodeUnsupportedOperationException "UnsupportedOperationException"
// This exception is thrown when the requested operation is not supported.
//
// * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
// This exception is thrown when the requested operation is not permitted.
//
// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
// This exception is thrown when the AWS account making the request to create
// or update an organization trail is not the master account for an organization
// in AWS Organizations. For more information, see Prepare For Creating a Trail
// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
// This exception is thrown when the IAM user or role that is used to create
// the organization trail is lacking one or more required permissions for creating
// an organization trail in a required service. For more information, see Prepare
// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging
func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error) { func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error) {
req, out := c.StopLoggingRequest(input) req, out := c.StopLoggingRequest(input)
@ -1694,6 +1808,35 @@ func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.R
// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" // * ErrCodeOperationNotPermittedException "OperationNotPermittedException"
// This exception is thrown when the requested operation is not permitted. // This exception is thrown when the requested operation is not permitted.
// //
// * ErrCodeAccessNotEnabledException "CloudTrailAccessNotEnabledException"
// This exception is thrown when trusted access has not been enabled between
// AWS CloudTrail and AWS Organizations. For more information, see Enabling
// Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html)
// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException"
// This exception is thrown when the IAM user or role that is used to create
// the organization trail is lacking one or more required permissions for creating
// an organization trail in a required service. For more information, see Prepare
// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeOrganizationsNotInUseException "OrganizationsNotInUseException"
// This exception is thrown when the request is made from an AWS account that
// is not a member of an organization. To make this request, sign in using the
// credentials of an account that belongs to an organization.
//
// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException"
// This exception is thrown when the AWS account making the request to create
// or update an organization trail is not the master account for an organization
// in AWS Organizations. For more information, see Prepare For Creating a Trail
// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// * ErrCodeOrganizationNotInAllFeaturesModeException "OrganizationNotInAllFeaturesModeException"
// This exception is thrown when AWS Organizations is not configured to support
// all features. All features must be enabled in AWS Organization to support
// creating an organization trail. For more information, see Prepare For Creating
// a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail
func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error) { func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error) {
req, out := c.UpdateTrailRequest(input) req, out := c.UpdateTrailRequest(input)
@ -1827,6 +1970,12 @@ type CreateTrailInput struct {
// The default is false. // The default is false.
IsMultiRegionTrail *bool `type:"boolean"` IsMultiRegionTrail *bool `type:"boolean"`
// Specifies whether the trail is created for all accounts in an organization
// in AWS Organizations, or only for the current AWS account. The default is
// false, and cannot be true unless the call is made on behalf of an AWS account
// that is the master account for an organization in AWS Organizations.
IsOrganizationTrail *bool `type:"boolean"`
// Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail.
// The value can be an alias name prefixed by "alias/", a fully specified ARN // The value can be an alias name prefixed by "alias/", a fully specified ARN
// to an alias, a fully specified ARN to a key, or a globally unique identifier. // to an alias, a fully specified ARN to a key, or a globally unique identifier.
@ -1932,6 +2081,12 @@ func (s *CreateTrailInput) SetIsMultiRegionTrail(v bool) *CreateTrailInput {
return s return s
} }
// SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
func (s *CreateTrailInput) SetIsOrganizationTrail(v bool) *CreateTrailInput {
s.IsOrganizationTrail = &v
return s
}
// SetKmsKeyId sets the KmsKeyId field's value. // SetKmsKeyId sets the KmsKeyId field's value.
func (s *CreateTrailInput) SetKmsKeyId(v string) *CreateTrailInput { func (s *CreateTrailInput) SetKmsKeyId(v string) *CreateTrailInput {
s.KmsKeyId = &v s.KmsKeyId = &v
@ -1982,6 +2137,9 @@ type CreateTrailOutput struct {
// Specifies whether the trail exists in one region or in all regions. // Specifies whether the trail exists in one region or in all regions.
IsMultiRegionTrail *bool `type:"boolean"` IsMultiRegionTrail *bool `type:"boolean"`
// Specifies whether the trail is an organization trail.
IsOrganizationTrail *bool `type:"boolean"`
// Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail.
// The value is a fully specified ARN to a KMS key in the format: // The value is a fully specified ARN to a KMS key in the format:
// //
@ -2055,6 +2213,12 @@ func (s *CreateTrailOutput) SetIsMultiRegionTrail(v bool) *CreateTrailOutput {
return s return s
} }
// SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
func (s *CreateTrailOutput) SetIsOrganizationTrail(v bool) *CreateTrailOutput {
s.IsOrganizationTrail = &v
return s
}
// SetKmsKeyId sets the KmsKeyId field's value. // SetKmsKeyId sets the KmsKeyId field's value.
func (s *CreateTrailOutput) SetKmsKeyId(v string) *CreateTrailOutput { func (s *CreateTrailOutput) SetKmsKeyId(v string) *CreateTrailOutput {
s.KmsKeyId = &v s.KmsKeyId = &v
@ -2277,7 +2441,10 @@ type DescribeTrailsInput struct {
// Specifies whether to include shadow trails in the response. A shadow trail // Specifies whether to include shadow trails in the response. A shadow trail
// is the replication in a region of a trail that was created in a different // is the replication in a region of a trail that was created in a different
// region. The default is true. // region, or in the case of an organization trail, the replication of an organization
// trail in member accounts. If you do not include shadow trails, organization
// trails in a member account and region replication trails will not be returned.
// The default is true.
IncludeShadowTrails *bool `locationName:"includeShadowTrails" type:"boolean"` IncludeShadowTrails *bool `locationName:"includeShadowTrails" type:"boolean"`
// Specifies a list of trail names, trail ARNs, or both, of the trails to describe. // Specifies a list of trail names, trail ARNs, or both, of the trails to describe.
@ -3692,6 +3859,9 @@ type Trail struct {
// Specifies whether the trail belongs only to one region or exists in all regions. // Specifies whether the trail belongs only to one region or exists in all regions.
IsMultiRegionTrail *bool `type:"boolean"` IsMultiRegionTrail *bool `type:"boolean"`
// Specifies whether the trail is an organization trail.
IsOrganizationTrail *bool `type:"boolean"`
// Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail.
// The value is a fully specified ARN to a KMS key in the format: // The value is a fully specified ARN to a KMS key in the format:
// //
@ -3777,6 +3947,12 @@ func (s *Trail) SetIsMultiRegionTrail(v bool) *Trail {
return s return s
} }
// SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
func (s *Trail) SetIsOrganizationTrail(v bool) *Trail {
s.IsOrganizationTrail = &v
return s
}
// SetKmsKeyId sets the KmsKeyId field's value. // SetKmsKeyId sets the KmsKeyId field's value.
func (s *Trail) SetKmsKeyId(v string) *Trail { func (s *Trail) SetKmsKeyId(v string) *Trail {
s.KmsKeyId = &v s.KmsKeyId = &v
@ -3862,6 +4038,17 @@ type UpdateTrailInput struct {
// it was created, and its shadow trails in other regions will be deleted. // it was created, and its shadow trails in other regions will be deleted.
IsMultiRegionTrail *bool `type:"boolean"` IsMultiRegionTrail *bool `type:"boolean"`
// Specifies whether the trail is applied to all accounts in an organization
// in AWS Organizations, or only for the current AWS account. The default is
// false, and cannot be true unless the call is made on behalf of an AWS account
// that is the master account for an organization in AWS Organizations. If the
// trail is not an organization trail and this is set to true, the trail will
// be created in all AWS accounts that belong to the organization. If the trail
// is an organization trail and this is set to false, the trail will remain
// in the current AWS account but be deleted from all member accounts in the
// organization.
IsOrganizationTrail *bool `type:"boolean"`
// Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail.
// The value can be an alias name prefixed by "alias/", a fully specified ARN // The value can be an alias name prefixed by "alias/", a fully specified ARN
// to an alias, a fully specified ARN to a key, or a globally unique identifier. // to an alias, a fully specified ARN to a key, or a globally unique identifier.
@ -3967,6 +4154,12 @@ func (s *UpdateTrailInput) SetIsMultiRegionTrail(v bool) *UpdateTrailInput {
return s return s
} }
// SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
func (s *UpdateTrailInput) SetIsOrganizationTrail(v bool) *UpdateTrailInput {
s.IsOrganizationTrail = &v
return s
}
// SetKmsKeyId sets the KmsKeyId field's value. // SetKmsKeyId sets the KmsKeyId field's value.
func (s *UpdateTrailInput) SetKmsKeyId(v string) *UpdateTrailInput { func (s *UpdateTrailInput) SetKmsKeyId(v string) *UpdateTrailInput {
s.KmsKeyId = &v s.KmsKeyId = &v
@ -4017,6 +4210,9 @@ type UpdateTrailOutput struct {
// Specifies whether the trail exists in one region or in all regions. // Specifies whether the trail exists in one region or in all regions.
IsMultiRegionTrail *bool `type:"boolean"` IsMultiRegionTrail *bool `type:"boolean"`
// Specifies whether the trail is an organization trail.
IsOrganizationTrail *bool `type:"boolean"`
// Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail.
// The value is a fully specified ARN to a KMS key in the format: // The value is a fully specified ARN to a KMS key in the format:
// //
@ -4090,6 +4286,12 @@ func (s *UpdateTrailOutput) SetIsMultiRegionTrail(v bool) *UpdateTrailOutput {
return s return s
} }
// SetIsOrganizationTrail sets the IsOrganizationTrail field's value.
func (s *UpdateTrailOutput) SetIsOrganizationTrail(v bool) *UpdateTrailOutput {
s.IsOrganizationTrail = &v
return s
}
// SetKmsKeyId sets the KmsKeyId field's value. // SetKmsKeyId sets the KmsKeyId field's value.
func (s *UpdateTrailOutput) SetKmsKeyId(v string) *UpdateTrailOutput { func (s *UpdateTrailOutput) SetKmsKeyId(v string) *UpdateTrailOutput {
s.KmsKeyId = &v s.KmsKeyId = &v

View File

@ -13,12 +13,30 @@ const (
// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
ErrCodeARNInvalidException = "CloudTrailARNInvalidException" ErrCodeARNInvalidException = "CloudTrailARNInvalidException"
// ErrCodeAccessNotEnabledException for service response error code
// "CloudTrailAccessNotEnabledException".
//
// This exception is thrown when trusted access has not been enabled between
// AWS CloudTrail and AWS Organizations. For more information, see Enabling
// Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html)
// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
ErrCodeAccessNotEnabledException = "CloudTrailAccessNotEnabledException"
// ErrCodeCloudWatchLogsDeliveryUnavailableException for service response error code // ErrCodeCloudWatchLogsDeliveryUnavailableException for service response error code
// "CloudWatchLogsDeliveryUnavailableException". // "CloudWatchLogsDeliveryUnavailableException".
// //
// Cannot set a CloudWatch Logs delivery for this region. // Cannot set a CloudWatch Logs delivery for this region.
ErrCodeCloudWatchLogsDeliveryUnavailableException = "CloudWatchLogsDeliveryUnavailableException" ErrCodeCloudWatchLogsDeliveryUnavailableException = "CloudWatchLogsDeliveryUnavailableException"
// ErrCodeInsufficientDependencyServiceAccessPermissionException for service response error code
// "InsufficientDependencyServiceAccessPermissionException".
//
// This exception is thrown when the IAM user or role that is used to create
// the organization trail is lacking one or more required permissions for creating
// an organization trail in a required service. For more information, see Prepare
// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
ErrCodeInsufficientDependencyServiceAccessPermissionException = "InsufficientDependencyServiceAccessPermissionException"
// ErrCodeInsufficientEncryptionPolicyException for service response error code // ErrCodeInsufficientEncryptionPolicyException for service response error code
// "InsufficientEncryptionPolicyException". // "InsufficientEncryptionPolicyException".
// //
@ -196,12 +214,38 @@ const (
// This exception is thrown when the maximum number of trails is reached. // This exception is thrown when the maximum number of trails is reached.
ErrCodeMaximumNumberOfTrailsExceededException = "MaximumNumberOfTrailsExceededException" ErrCodeMaximumNumberOfTrailsExceededException = "MaximumNumberOfTrailsExceededException"
// ErrCodeNotOrganizationMasterAccountException for service response error code
// "NotOrganizationMasterAccountException".
//
// This exception is thrown when the AWS account making the request to create
// or update an organization trail is not the master account for an organization
// in AWS Organizations. For more information, see Prepare For Creating a Trail
// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
ErrCodeNotOrganizationMasterAccountException = "NotOrganizationMasterAccountException"
// ErrCodeOperationNotPermittedException for service response error code // ErrCodeOperationNotPermittedException for service response error code
// "OperationNotPermittedException". // "OperationNotPermittedException".
// //
// This exception is thrown when the requested operation is not permitted. // This exception is thrown when the requested operation is not permitted.
ErrCodeOperationNotPermittedException = "OperationNotPermittedException" ErrCodeOperationNotPermittedException = "OperationNotPermittedException"
// ErrCodeOrganizationNotInAllFeaturesModeException for service response error code
// "OrganizationNotInAllFeaturesModeException".
//
// This exception is thrown when AWS Organizations is not configured to support
// all features. All features must be enabled in AWS Organization to support
// creating an organization trail. For more information, see Prepare For Creating
// a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html).
ErrCodeOrganizationNotInAllFeaturesModeException = "OrganizationNotInAllFeaturesModeException"
// ErrCodeOrganizationsNotInUseException for service response error code
// "OrganizationsNotInUseException".
//
// This exception is thrown when the request is made from an AWS account that
// is not a member of an organization. To make this request, sign in using the
// credentials of an account that belongs to an organization.
ErrCodeOrganizationsNotInUseException = "OrganizationsNotInUseException"
// ErrCodeResourceNotFoundException for service response error code // ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException". // "ResourceNotFoundException".
// //

View File

@ -52,8 +52,7 @@ func (c *CloudWatch) DeleteAlarmsRequest(input *DeleteAlarmsInput) (req *request
output = &DeleteAlarmsOutput{} output = &DeleteAlarmsOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -133,6 +132,7 @@ func (c *CloudWatch) DeleteDashboardsRequest(input *DeleteDashboardsInput) (req
output = &DeleteDashboardsOutput{} output = &DeleteDashboardsOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -570,8 +570,7 @@ func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput)
output = &DisableAlarmActionsOutput{} output = &DisableAlarmActionsOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -647,8 +646,7 @@ func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) (
output = &EnableAlarmActionsOutput{} output = &EnableAlarmActionsOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1488,25 +1486,24 @@ func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) (req *req
output = &PutMetricAlarmOutput{} output = &PutMetricAlarmOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
// PutMetricAlarm API operation for Amazon CloudWatch. // PutMetricAlarm API operation for Amazon CloudWatch.
// //
// Creates or updates an alarm and associates it with the specified metric. // Creates or updates an alarm and associates it with the specified metric or
// Optionally, this operation can associate one or more Amazon SNS resources // metric math expression.
// with the alarm.
// //
// When this operation creates an alarm, the alarm state is immediately set // When this operation creates an alarm, the alarm state is immediately set
// to INSUFFICIENT_DATA. The alarm is evaluated and its state is set appropriately. // to INSUFFICIENT_DATA. The alarm is then evaluated and its state is set appropriately.
// Any actions associated with the state are then executed. // Any actions associated with the new state are then executed.
// //
// When you update an existing alarm, its state is left unchanged, but the update // When you update an existing alarm, its state is left unchanged, but the update
// completely overwrites the previous configuration of the alarm. // completely overwrites the previous configuration of the alarm.
// //
// If you are an IAM user, you must have Amazon EC2 permissions for some operations: // If you are an IAM user, you must have Amazon EC2 permissions for some alarm
// operations:
// //
// * iam:CreateServiceLinkedRole for all alarms with EC2 actions // * iam:CreateServiceLinkedRole for all alarms with EC2 actions
// //
@ -1536,8 +1533,7 @@ func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) (req *req
// The first time you create an alarm in the AWS Management Console, the CLI, // The first time you create an alarm in the AWS Management Console, the CLI,
// or by using the PutMetricAlarm API, CloudWatch creates the necessary service-linked // or by using the PutMetricAlarm API, CloudWatch creates the necessary service-linked
// role for you. The service-linked role is called AWSServiceRoleForCloudWatchEvents. // role for you. The service-linked role is called AWSServiceRoleForCloudWatchEvents.
// For more information about service-linked roles, see AWS service-linked role // For more information, see AWS service-linked role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role).
// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role).
// //
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about // with awserr.Error's Code and Message methods to get detailed information about
@ -1611,17 +1607,16 @@ func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *reque
output = &PutMetricDataOutput{} output = &PutMetricDataOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
// PutMetricData API operation for Amazon CloudWatch. // PutMetricData API operation for Amazon CloudWatch.
// //
// Publishes metric data to Amazon CloudWatch. CloudWatch associates the data // Publishes metric data points to Amazon CloudWatch. CloudWatch associates
// with the specified metric. If the specified metric does not exist, CloudWatch // the data points with the specified metric. If the specified metric does not
// creates the metric. When CloudWatch creates a metric, it can take up to fifteen // exist, CloudWatch creates the metric. When CloudWatch creates a metric, it
// minutes for the metric to appear in calls to ListMetrics. // can take up to fifteen minutes for the metric to appear in calls to ListMetrics.
// //
// You can publish either individual data points in the Value field, or arrays // You can publish either individual data points in the Value field, or arrays
// of values and the number of times each value occurred during the period by // of values and the number of times each value occurred during the period by
@ -1649,11 +1644,9 @@ func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *reque
// 48 hours to become available for GetMetricData or GetMetricStatistics from // 48 hours to become available for GetMetricData or GetMetricStatistics from
// the time they are submitted. // the time they are submitted.
// //
// CloudWatch needs raw data points to calculate percentile statistics. These // CloudWatch needs raw data points to calculate percentile statistics. If you
// raw data points could be published individually or as part of Values and // publish data using a statistic set instead, you can only retrieve percentile
// Counts arrays. If you publish data using statistic sets in the StatisticValues // statistics for this data if one of the following conditions is true:
// field instead, you can only retrieve percentile statistics for this data
// if one of the following conditions is true:
// //
// * The SampleCount value of the statistic set is 1 and Min, Max, and Sum // * The SampleCount value of the statistic set is 1 and Min, Max, and Sum
// are all equal. // are all equal.
@ -1741,8 +1734,7 @@ func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) (req *reque
output = &SetAlarmStateOutput{} output = &SetAlarmStateOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -3536,7 +3528,7 @@ type Metric struct {
// The dimensions for the metric. // The dimensions for the metric.
Dimensions []*Dimension `type:"list"` Dimensions []*Dimension `type:"list"`
// The name of the metric. // The name of the metric. This is a required field.
MetricName *string `min:"1" type:"string"` MetricName *string `min:"1" type:"string"`
// The namespace of the metric. // The namespace of the metric.
@ -3652,6 +3644,8 @@ type MetricAlarm struct {
// The name of the metric associated with the alarm. // The name of the metric associated with the alarm.
MetricName *string `min:"1" type:"string"` MetricName *string `min:"1" type:"string"`
Metrics []*MetricDataQuery `type:"list"`
// The namespace of the metric associated with the alarm. // The namespace of the metric associated with the alarm.
Namespace *string `min:"1" type:"string"` Namespace *string `min:"1" type:"string"`
@ -3783,6 +3777,12 @@ func (s *MetricAlarm) SetMetricName(v string) *MetricAlarm {
return s return s
} }
// SetMetrics sets the Metrics field's value.
func (s *MetricAlarm) SetMetrics(v []*MetricDataQuery) *MetricAlarm {
s.Metrics = v
return s
}
// SetNamespace sets the Namespace field's value. // SetNamespace sets the Namespace field's value.
func (s *MetricAlarm) SetNamespace(v string) *MetricAlarm { func (s *MetricAlarm) SetNamespace(v string) *MetricAlarm {
s.Namespace = &v s.Namespace = &v
@ -3849,23 +3849,43 @@ func (s *MetricAlarm) SetUnit(v string) *MetricAlarm {
return s return s
} }
// This structure indicates the metric data to return, and whether this call // This structure is used in both GetMetricData and PutMetricAlarm. The supported
// is just retrieving a batch set of data for one metric, or is performing a // use of this structure is different for those two operations.
// math expression on metric data. A single GetMetricData call can include up //
// to 100 MetricDataQuery structures. // When used in GetMetricData, it indicates the metric data to return, and whether
// this call is just retrieving a batch set of data for one metric, or is performing
// a math expression on metric data. A single GetMetricData call can include
// up to 100 MetricDataQuery structures.
//
// When used in PutMetricAlarm, it enables you to create an alarm based on a
// metric math expression. Each MetricDataQuery in the array specifies either
// a metric to retrieve, or a math expression to be performed on retrieved metrics.
// A single PutMetricAlarm call can include up to 20 MetricDataQuery structures
// in the array. The 20 structures can include as many as 10 structures that
// contain a MetricStat parameter to retrieve a metric, and as many as 10 structures
// that contain the Expression parameter to perform a math expression. Any expression
// used in a PutMetricAlarm operation must return a single time series. For
// more information, see Metric Math Syntax and Functions (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax)
// in the Amazon CloudWatch User Guide.
//
// Some of the parameters of this structure also have different uses whether
// you are using this structure in a GetMetricData operation or a PutMetricAlarm
// operation. These differences are explained in the following parameter list.
type MetricDataQuery struct { type MetricDataQuery struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The math expression to be performed on the returned data, if this structure // The math expression to be performed on the returned data, if this object
// is performing a math expression. For more information about metric math expressions, // is performing a math expression. This expression can use the Id of the other
// see Metric Math Syntax and Functions (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) // metrics to refer to those metrics, and can also use the Id of other expressions
// to use the result of those expressions. For more information about metric
// math expressions, see Metric Math Syntax and Functions (http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax)
// in the Amazon CloudWatch User Guide. // in the Amazon CloudWatch User Guide.
// //
// Within one MetricDataQuery structure, you must specify either Expression // Within each MetricDataQuery object, you must specify either Expression or
// or MetricStat but not both. // MetricStat but not both.
Expression *string `min:"1" type:"string"` Expression *string `min:"1" type:"string"`
// A short name used to tie this structure to the results in the response. This // A short name used to tie this object to the results in the response. This
// name must be unique within a single call to GetMetricData. If you are performing // name must be unique within a single call to GetMetricData. If you are performing
// math expressions on this set of data, this name represents that data and // math expressions on this set of data, this name represents that data and
// can serve as a variable in the mathematical expression. The valid characters // can serve as a variable in the mathematical expression. The valid characters
@ -3882,17 +3902,21 @@ type MetricDataQuery struct {
Label *string `type:"string"` Label *string `type:"string"`
// The metric to be returned, along with statistics, period, and units. Use // The metric to be returned, along with statistics, period, and units. Use
// this parameter only if this structure is performing a data retrieval and // this parameter only if this object is retrieving a metric and not performing
// not performing a math expression on the returned data. // a math expression on returned data.
// //
// Within one MetricDataQuery structure, you must specify either Expression // Within one MetricDataQuery object, you must specify either Expression or
// or MetricStat but not both. // MetricStat but not both.
MetricStat *MetricStat `type:"structure"` MetricStat *MetricStat `type:"structure"`
// Indicates whether to return the time stamps and raw data values of this metric. // When used in GetMetricData, this option indicates whether to return the timestamps
// If you are performing this call just to do math expressions and do not also // and raw data values of this metric. If you are performing this call just
// need the raw data returned, you can specify False. If you omit this, the // to do math expressions and do not also need the raw data returned, you can
// default of True is used. // specify False. If you omit this, the default of True is used.
//
// When used in PutMetricAlarm, specify True for the one expression result to
// use as the alarm. For all other metrics and expressions in the same PutMetricAlarm
// operation, specify ReturnData as False.
ReturnData *bool `type:"boolean"` ReturnData *bool `type:"boolean"`
} }
@ -3962,7 +3986,7 @@ func (s *MetricDataQuery) SetReturnData(v bool) *MetricDataQuery {
// A GetMetricData call returns an array of MetricDataResult structures. Each // A GetMetricData call returns an array of MetricDataResult structures. Each
// of these structures includes the data points for that metric, along with // of these structures includes the data points for that metric, along with
// the time stamps of those data points and other identifying information. // the timestamps of those data points and other identifying information.
type MetricDataResult struct { type MetricDataResult struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
@ -3983,13 +4007,13 @@ type MetricDataResult struct {
// that an error occurred. Retry your request using NextToken, if present. // that an error occurred. Retry your request using NextToken, if present.
StatusCode *string `type:"string" enum:"StatusCode"` StatusCode *string `type:"string" enum:"StatusCode"`
// The time stamps for the data points, formatted in Unix timestamp format. // The timestamps for the data points, formatted in Unix timestamp format. The
// The number of time stamps always matches the number of values and the value // number of timestamps always matches the number of values and the value for
// for Timestamps[x] is Values[x]. // Timestamps[x] is Values[x].
Timestamps []*time.Time `type:"list"` Timestamps []*time.Time `type:"list"`
// The data points for the metric corresponding to Timestamps. The number of // The data points for the metric corresponding to Timestamps. The number of
// values always matches the number of time stamps and the time stamp for Values[x] // values always matches the number of timestamps and the timestamp for Values[x]
// is Timestamps[x]. // is Timestamps[x].
Values []*float64 `type:"list"` Values []*float64 `type:"list"`
} }
@ -4214,7 +4238,7 @@ type MetricStat struct {
// Metric is a required field // Metric is a required field
Metric *Metric `type:"structure" required:"true"` Metric *Metric `type:"structure" required:"true"`
// The period to use when retrieving the metric. // The period, in seconds, to use when retrieving the metric.
// //
// Period is a required field // Period is a required field
Period *int64 `min:"1" type:"integer" required:"true"` Period *int64 `min:"1" type:"integer" required:"true"`
@ -4384,7 +4408,7 @@ type PutMetricAlarmInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// Indicates whether actions should be executed during any changes to the alarm // Indicates whether actions should be executed during any changes to the alarm
// state. // state. The default is TRUE.
ActionsEnabled *bool `type:"boolean"` ActionsEnabled *bool `type:"boolean"`
// The actions to execute when this alarm transitions to the ALARM state from // The actions to execute when this alarm transitions to the ALARM state from
@ -4402,7 +4426,7 @@ type PutMetricAlarmInput struct {
// The description for the alarm. // The description for the alarm.
AlarmDescription *string `type:"string"` AlarmDescription *string `type:"string"`
// The name for the alarm. This name must be unique within the AWS account. // The name for the alarm. This name must be unique within your AWS account.
// //
// AlarmName is a required field // AlarmName is a required field
AlarmName *string `min:"1" type:"string" required:"true"` AlarmName *string `min:"1" type:"string" required:"true"`
@ -4419,7 +4443,7 @@ type PutMetricAlarmInput struct {
// in the Amazon CloudWatch User Guide. // in the Amazon CloudWatch User Guide.
DatapointsToAlarm *int64 `min:"1" type:"integer"` DatapointsToAlarm *int64 `min:"1" type:"integer"`
// The dimensions for the metric associated with the alarm. // The dimensions for the metric specified in MetricName.
Dimensions []*Dimension `type:"list"` Dimensions []*Dimension `type:"list"`
// Used only for alarms based on percentiles. If you specify ignore, the alarm // Used only for alarms based on percentiles. If you specify ignore, the alarm
@ -4433,7 +4457,7 @@ type PutMetricAlarmInput struct {
EvaluateLowSampleCountPercentile *string `min:"1" type:"string"` EvaluateLowSampleCountPercentile *string `min:"1" type:"string"`
// The number of periods over which data is compared to the specified threshold. // The number of periods over which data is compared to the specified threshold.
// If you are setting an alarm which requires that a number of consecutive data // If you are setting an alarm that requires that a number of consecutive data
// points be breaching to trigger the alarm, this value specifies that number. // points be breaching to trigger the alarm, this value specifies that number.
// If you are setting an "M out of N" alarm, this value is the N. // If you are setting an "M out of N" alarm, this value is the N.
// //
@ -4443,9 +4467,10 @@ type PutMetricAlarmInput struct {
// EvaluationPeriods is a required field // EvaluationPeriods is a required field
EvaluationPeriods *int64 `min:"1" type:"integer" required:"true"` EvaluationPeriods *int64 `min:"1" type:"integer" required:"true"`
// The percentile statistic for the metric associated with the alarm. Specify // The percentile statistic for the metric specified in MetricName. Specify
// a value between p0.0 and p100. When you call PutMetricAlarm, you must specify // a value between p0.0 and p100. When you call PutMetricAlarm and specify a
// either Statistic or ExtendedStatistic, but not both. // MetricName, you must specify either Statistic or ExtendedStatistic, but not
// both.
ExtendedStatistic *string `type:"string"` ExtendedStatistic *string `type:"string"`
// The actions to execute when this alarm transitions to the INSUFFICIENT_DATA // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
@ -4463,28 +4488,39 @@ type PutMetricAlarmInput struct {
// The name for the metric associated with the alarm. // The name for the metric associated with the alarm.
// //
// MetricName is a required field // If you are creating an alarm based on a math expression, you cannot specify
MetricName *string `min:"1" type:"string" required:"true"` // this parameter, or any of the Dimensions, Period, Namespace, Statistic, or
// ExtendedStatistic parameters. Instead, you specify all this information in
// the Metrics array.
MetricName *string `min:"1" type:"string"`
// The namespace for the metric associated with the alarm. // An array of MetricDataQuery structures that enable you to create an alarm
// based on the result of a metric math expression. Each item in the Metrics
// array either retrieves a metric or performs a math expression.
// //
// Namespace is a required field // If you use the Metrics parameter, you cannot include the MetricName, Dimensions,
Namespace *string `min:"1" type:"string" required:"true"` // Period, Namespace, Statistic, or ExtendedStatistic parameters of PutMetricAlarm
// in the same operation. Instead, you retrieve the metrics you are using in
// your math expression as part of the Metrics array.
Metrics []*MetricDataQuery `type:"list"`
// The namespace for the metric associated specified in MetricName.
Namespace *string `min:"1" type:"string"`
// The actions to execute when this alarm transitions to an OK state from any // The actions to execute when this alarm transitions to an OK state from any
// other state. Each action is specified as an Amazon Resource Name (ARN). // other state. Each action is specified as an Amazon Resource Name (ARN).
// //
// Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate
// | arn:aws:automate:region:ec2:recover | arn:aws:sns:region:account-id:sns-topic-name // | arn:aws:automate:region:ec2:recover | arn:aws:automate:region:ec2:reboot
// | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-idautoScalingGroupName/group-friendly-name:policyName/policy-friendly-name // | arn:aws:sns:region:account-id:sns-topic-name | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-idautoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
// //
// Valid Values (for use with IAM roles): arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0 // Valid Values (for use with IAM roles): arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0
// | arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0 // | arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0
// | arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0 // | arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0
OKActions []*string `type:"list"` OKActions []*string `type:"list"`
// The period, in seconds, over which the specified statistic is applied. Valid // The length, in seconds, used each time the metric specified in MetricName
// values are 10, 30, and any multiple of 60. // is evaluated. Valid values are 10, 30, and any multiple of 60.
// //
// Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData // Be sure to specify 10 or 30 only for metrics that are stored by a PutMetricData
// call with a StorageResolution of 1. If you specify a period of 10 or 30 for // call with a StorageResolution of 1. If you specify a period of 10 or 30 for
@ -4498,13 +4534,12 @@ type PutMetricAlarmInput struct {
// //
// An alarm's total current evaluation period can be no longer than one day, // An alarm's total current evaluation period can be no longer than one day,
// so Period multiplied by EvaluationPeriods cannot be more than 86,400 seconds. // so Period multiplied by EvaluationPeriods cannot be more than 86,400 seconds.
// Period *int64 `min:"1" type:"integer"`
// Period is a required field
Period *int64 `min:"1" type:"integer" required:"true"`
// The statistic for the metric associated with the alarm, other than percentile. // The statistic for the metric specified in MetricName, other than percentile.
// For percentile statistics, use ExtendedStatistic. When you call PutMetricAlarm, // For percentile statistics, use ExtendedStatistic. When you call PutMetricAlarm
// you must specify either Statistic or ExtendedStatistic, but not both. // and specify a MetricName, you must specify either Statistic or ExtendedStatistic,
// but not both.
Statistic *string `type:"string" enum:"Statistic"` Statistic *string `type:"string" enum:"Statistic"`
// The value against which the specified statistic is compared. // The value against which the specified statistic is compared.
@ -4565,21 +4600,12 @@ func (s *PutMetricAlarmInput) Validate() error {
if s.EvaluationPeriods != nil && *s.EvaluationPeriods < 1 { if s.EvaluationPeriods != nil && *s.EvaluationPeriods < 1 {
invalidParams.Add(request.NewErrParamMinValue("EvaluationPeriods", 1)) invalidParams.Add(request.NewErrParamMinValue("EvaluationPeriods", 1))
} }
if s.MetricName == nil {
invalidParams.Add(request.NewErrParamRequired("MetricName"))
}
if s.MetricName != nil && len(*s.MetricName) < 1 { if s.MetricName != nil && len(*s.MetricName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
} }
if s.Namespace == nil {
invalidParams.Add(request.NewErrParamRequired("Namespace"))
}
if s.Namespace != nil && len(*s.Namespace) < 1 { if s.Namespace != nil && len(*s.Namespace) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
} }
if s.Period == nil {
invalidParams.Add(request.NewErrParamRequired("Period"))
}
if s.Period != nil && *s.Period < 1 { if s.Period != nil && *s.Period < 1 {
invalidParams.Add(request.NewErrParamMinValue("Period", 1)) invalidParams.Add(request.NewErrParamMinValue("Period", 1))
} }
@ -4599,6 +4625,16 @@ func (s *PutMetricAlarmInput) Validate() error {
} }
} }
} }
if s.Metrics != nil {
for i, v := range s.Metrics {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Metrics", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 { if invalidParams.Len() > 0 {
return invalidParams return invalidParams
@ -4678,6 +4714,12 @@ func (s *PutMetricAlarmInput) SetMetricName(v string) *PutMetricAlarmInput {
return s return s
} }
// SetMetrics sets the Metrics field's value.
func (s *PutMetricAlarmInput) SetMetrics(v []*MetricDataQuery) *PutMetricAlarmInput {
s.Metrics = v
return s
}
// SetNamespace sets the Namespace field's value. // SetNamespace sets the Namespace field's value.
func (s *PutMetricAlarmInput) SetNamespace(v string) *PutMetricAlarmInput { func (s *PutMetricAlarmInput) SetNamespace(v string) *PutMetricAlarmInput {
s.Namespace = &v s.Namespace = &v

View File

@ -52,8 +52,7 @@ func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *reque
output = &DeleteRuleOutput{} output = &DeleteRuleOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -66,6 +65,12 @@ func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *reque
// When you delete a rule, incoming events might continue to match to the deleted // When you delete a rule, incoming events might continue to match to the deleted
// rule. Allow a short period of time for changes to take effect. // rule. Allow a short period of time for changes to take effect.
// //
// Managed rules are rules created and managed by another AWS service on your
// behalf. These rules are created by those other AWS services to support functionality
// in those services. You can delete these rules using the Force option, but
// you should do so only if you are sure the other service is not still using
// that rule.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about // with awserr.Error's Code and Message methods to get detailed information about
// the error. // the error.
@ -77,6 +82,13 @@ func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *reque
// * ErrCodeConcurrentModificationException "ConcurrentModificationException" // * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target. // There is concurrent modification on a rule or target.
// //
// * ErrCodeManagedRuleException "ManagedRuleException"
// This rule was created by an AWS service on behalf of your account. It is
// managed by that service. If you see this error in response to DeleteRule
// or RemoveTargets, you can use the Force parameter in those calls to delete
// the rule or remove targets from the rule. You cannot modify these managed
// rules by using DisableRule, EnableRule, PutTargets, or PutRule.
//
// * ErrCodeInternalException "InternalException" // * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes. // This exception occurs due to unexpected causes.
// //
@ -310,8 +322,7 @@ func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *req
output = &DisableRuleOutput{} output = &DisableRuleOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -337,6 +348,13 @@ func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *req
// * ErrCodeConcurrentModificationException "ConcurrentModificationException" // * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target. // There is concurrent modification on a rule or target.
// //
// * ErrCodeManagedRuleException "ManagedRuleException"
// This rule was created by an AWS service on behalf of your account. It is
// managed by that service. If you see this error in response to DeleteRule
// or RemoveTargets, you can use the Force parameter in those calls to delete
// the rule or remove targets from the rule. You cannot modify these managed
// rules by using DisableRule, EnableRule, PutTargets, or PutRule.
//
// * ErrCodeInternalException "InternalException" // * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes. // This exception occurs due to unexpected causes.
// //
@ -401,8 +419,7 @@ func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *reque
output = &EnableRuleOutput{} output = &EnableRuleOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -428,6 +445,13 @@ func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *reque
// * ErrCodeConcurrentModificationException "ConcurrentModificationException" // * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target. // There is concurrent modification on a rule or target.
// //
// * ErrCodeManagedRuleException "ManagedRuleException"
// This rule was created by an AWS service on behalf of your account. It is
// managed by that service. If you see this error in response to DeleteRule
// or RemoveTargets, you can use the Force parameter in those calls to delete
// the rule or remove targets from the rule. You cannot modify these managed
// rules by using DisableRule, EnableRule, PutTargets, or PutRule.
//
// * ErrCodeInternalException "InternalException" // * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes. // This exception occurs due to unexpected causes.
// //
@ -817,23 +841,32 @@ func (c *CloudWatchEvents) PutPermissionRequest(input *PutPermissionInput) (req
output = &PutPermissionOutput{} output = &PutPermissionOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
// PutPermission API operation for Amazon CloudWatch Events. // PutPermission API operation for Amazon CloudWatch Events.
// //
// Running PutPermission permits the specified AWS account to put events to // Running PutPermission permits the specified AWS account or AWS organization
// your account's default event bus. CloudWatch Events rules in your account // to put events to your account's default event bus. CloudWatch Events rules
// are triggered by these events arriving to your default event bus. // in your account are triggered by these events arriving to your default event
// bus.
// //
// For another account to send events to your account, that external account // For another account to send events to your account, that external account
// must have a CloudWatch Events rule with your account's default event bus // must have a CloudWatch Events rule with your account's default event bus
// as a target. // as a target.
// //
// To enable multiple AWS accounts to put events to your default event bus, // To enable multiple AWS accounts to put events to your default event bus,
// run PutPermission once for each of these accounts. // run PutPermission once for each of these accounts. Or, if all the accounts
// are members of the same AWS organization, you can run PutPermission once
// specifying Principal as "*" and specifying the AWS organization ID in Condition,
// to grant permissions to all accounts in that organization.
//
// If you grant permissions using an organization, then accounts in that organization
// must specify a RoleArn with proper permissions when they use PutTarget to
// add your account's event bus as a target. For more information, see Sending
// and Receiving Events Between AWS Accounts (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEvents-CrossAccountEventDelivery.html)
// in the Amazon CloudWatch Events User Guide.
// //
// The permission policy on the default event bus cannot exceed 10 KB in size. // The permission policy on the default event bus cannot exceed 10 KB in size.
// //
@ -946,6 +979,20 @@ func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Req
// and rules. Be sure to use the correct ARN characters when creating event // and rules. Be sure to use the correct ARN characters when creating event
// patterns so that they match the ARN syntax in the event you want to match. // patterns so that they match the ARN syntax in the event you want to match.
// //
// In CloudWatch Events, it is possible to create rules that lead to infinite
// loops, where a rule is fired repeatedly. For example, a rule might detect
// that ACLs have changed on an S3 bucket, and trigger software to change them
// to the desired state. If the rule is not written carefully, the subsequent
// change to the ACLs fires the rule again, creating an infinite loop.
//
// To prevent this, write the rules so that the triggered actions do not re-fire
// the same rule. For example, your rule could fire only if ACLs are found to
// be in a bad state, instead of after any change.
//
// An infinite loop can quickly cause higher than expected charges. We recommend
// that you use budgeting, which alerts you when charges exceed your specified
// limit. For more information, see Managing Your Costs with Budgets (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-managing-costs.html).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about // with awserr.Error's Code and Message methods to get detailed information about
// the error. // the error.
@ -963,6 +1010,13 @@ func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Req
// * ErrCodeConcurrentModificationException "ConcurrentModificationException" // * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target. // There is concurrent modification on a rule or target.
// //
// * ErrCodeManagedRuleException "ManagedRuleException"
// This rule was created by an AWS service on behalf of your account. It is
// managed by that service. If you see this error in response to DeleteRule
// or RemoveTargets, you can use the Force parameter in those calls to delete
// the rule or remove targets from the rule. You cannot modify these managed
// rules by using DisableRule, EnableRule, PutTargets, or PutRule.
//
// * ErrCodeInternalException "InternalException" // * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes. // This exception occurs due to unexpected causes.
// //
@ -1096,6 +1150,13 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque
// is charged as a custom event. The account receiving the event is not charged. // is charged as a custom event. The account receiving the event is not charged.
// For more information, see Amazon CloudWatch Pricing (https://aws.amazon.com/cloudwatch/pricing/). // For more information, see Amazon CloudWatch Pricing (https://aws.amazon.com/cloudwatch/pricing/).
// //
// If you are setting the event bus of another account as the target, and that
// account granted permission to your account through an organization instead
// of directly by the account ID, then you must specify a RoleArn with proper
// permissions in the Target structure. For more information, see Sending and
// Receiving Events Between AWS Accounts (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEvents-CrossAccountEventDelivery.html)
// in the Amazon CloudWatch Events User Guide.
//
// For more information about enabling cross-account events, see PutPermission. // For more information about enabling cross-account events, see PutPermission.
// //
// Input, InputPath, and InputTransformer are mutually exclusive and optional // Input, InputPath, and InputTransformer are mutually exclusive and optional
@ -1146,6 +1207,13 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque
// * ErrCodeLimitExceededException "LimitExceededException" // * ErrCodeLimitExceededException "LimitExceededException"
// You tried to create more rules or add more targets to a rule than is allowed. // You tried to create more rules or add more targets to a rule than is allowed.
// //
// * ErrCodeManagedRuleException "ManagedRuleException"
// This rule was created by an AWS service on behalf of your account. It is
// managed by that service. If you see this error in response to DeleteRule
// or RemoveTargets, you can use the Force parameter in those calls to delete
// the rule or remove targets from the rule. You cannot modify these managed
// rules by using DisableRule, EnableRule, PutTargets, or PutRule.
//
// * ErrCodeInternalException "InternalException" // * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes. // This exception occurs due to unexpected causes.
// //
@ -1210,8 +1278,7 @@ func (c *CloudWatchEvents) RemovePermissionRequest(input *RemovePermissionInput)
output = &RemovePermissionOutput{} output = &RemovePermissionOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1331,6 +1398,13 @@ func (c *CloudWatchEvents) RemoveTargetsRequest(input *RemoveTargetsInput) (req
// * ErrCodeConcurrentModificationException "ConcurrentModificationException" // * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// There is concurrent modification on a rule or target. // There is concurrent modification on a rule or target.
// //
// * ErrCodeManagedRuleException "ManagedRuleException"
// This rule was created by an AWS service on behalf of your account. It is
// managed by that service. If you see this error in response to DeleteRule
// or RemoveTargets, you can use the Force parameter in those calls to delete
// the rule or remove targets from the rule. You cannot modify these managed
// rules by using DisableRule, EnableRule, PutTargets, or PutRule.
//
// * ErrCodeInternalException "InternalException" // * ErrCodeInternalException "InternalException"
// This exception occurs due to unexpected causes. // This exception occurs due to unexpected causes.
// //
@ -1642,9 +1716,90 @@ func (s *BatchRetryStrategy) SetAttempts(v int64) *BatchRetryStrategy {
return s return s
} }
// A JSON string which you can use to limit the event bus permissions you are
// granting to only accounts that fulfill the condition. Currently, the only
// supported condition is membership in a certain AWS organization. The string
// must contain Type, Key, and Value fields. The Value field specifies the ID
// of the AWS organization. Following is an example value for Condition:
//
// '{"Type" : "StringEquals", "Key": "aws:PrincipalOrgID", "Value": "o-1234567890"}'
type Condition struct {
_ struct{} `type:"structure"`
// Specifies the key for the condition. Currently the only supported key is
// aws:PrincipalOrgID.
//
// Key is a required field
Key *string `type:"string" required:"true"`
// Specifies the type of condition. Currently the only supported value is StringEquals.
//
// Type is a required field
Type *string `type:"string" required:"true"`
// Specifies the value for the key. Currently, this must be the ID of the organization.
//
// Value is a required field
Value *string `type:"string" required:"true"`
}
// String returns the string representation
func (s Condition) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Condition) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Condition) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Condition"}
if s.Key == nil {
invalidParams.Add(request.NewErrParamRequired("Key"))
}
if s.Type == nil {
invalidParams.Add(request.NewErrParamRequired("Type"))
}
if s.Value == nil {
invalidParams.Add(request.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetKey sets the Key field's value.
func (s *Condition) SetKey(v string) *Condition {
s.Key = &v
return s
}
// SetType sets the Type field's value.
func (s *Condition) SetType(v string) *Condition {
s.Type = &v
return s
}
// SetValue sets the Value field's value.
func (s *Condition) SetValue(v string) *Condition {
s.Value = &v
return s
}
type DeleteRuleInput struct { type DeleteRuleInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// If this is a managed rule, created by an AWS service on your behalf, you
// must specify Force as True to delete the rule. This parameter is ignored
// for rules that are not managed rules. You can check whether a rule is a managed
// rule by using DescribeRule or ListRules and checking the ManagedBy field
// of the response.
Force *bool `type:"boolean"`
// The name of the rule. // The name of the rule.
// //
// Name is a required field // Name is a required field
@ -1677,6 +1832,12 @@ func (s *DeleteRuleInput) Validate() error {
return nil return nil
} }
// SetForce sets the Force field's value.
func (s *DeleteRuleInput) SetForce(v bool) *DeleteRuleInput {
s.Force = &v
return s
}
// SetName sets the Name field's value. // SetName sets the Name field's value.
func (s *DeleteRuleInput) SetName(v string) *DeleteRuleInput { func (s *DeleteRuleInput) SetName(v string) *DeleteRuleInput {
s.Name = &v s.Name = &v
@ -1807,6 +1968,10 @@ type DescribeRuleOutput struct {
// in the Amazon CloudWatch Events User Guide. // in the Amazon CloudWatch Events User Guide.
EventPattern *string `type:"string"` EventPattern *string `type:"string"`
// If this is a managed rule, created by an AWS service on your behalf, this
// field displays the principal name of the AWS service that created the rule.
ManagedBy *string `min:"1" type:"string"`
// The name of the rule. // The name of the rule.
Name *string `min:"1" type:"string"` Name *string `min:"1" type:"string"`
@ -1848,6 +2013,12 @@ func (s *DescribeRuleOutput) SetEventPattern(v string) *DescribeRuleOutput {
return s return s
} }
// SetManagedBy sets the ManagedBy field's value.
func (s *DescribeRuleOutput) SetManagedBy(v string) *DescribeRuleOutput {
s.ManagedBy = &v
return s
}
// SetName sets the Name field's value. // SetName sets the Name field's value.
func (s *DescribeRuleOutput) SetName(v string) *DescribeRuleOutput { func (s *DescribeRuleOutput) SetName(v string) *DescribeRuleOutput {
s.Name = &v s.Name = &v
@ -2754,15 +2925,28 @@ type PutPermissionInput struct {
// Action is a required field // Action is a required field
Action *string `min:"1" type:"string" required:"true"` Action *string `min:"1" type:"string" required:"true"`
// This parameter enables you to limit the permission to accounts that fulfill
// a certain condition, such as being a member of a certain AWS organization.
// For more information about AWS Organizations, see What Is AWS Organizations
// (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html)
// in the AWS Organizations User Guide.
//
// If you specify Condition with an AWS organization ID, and specify "*" as
// the value for Principal, you grant permission to all the accounts in the
// named organization.
//
// The Condition is a JSON string which must contain Type, Key, and Value fields.
Condition *Condition `type:"structure"`
// The 12-digit AWS account ID that you are permitting to put events to your // The 12-digit AWS account ID that you are permitting to put events to your
// default event bus. Specify "*" to permit any account to put events to your // default event bus. Specify "*" to permit any account to put events to your
// default event bus. // default event bus.
// //
// If you specify "*", avoid creating rules that may match undesirable events. // If you specify "*" without specifying Condition, avoid creating rules that
// To create more secure rules, make sure that the event pattern for each rule // may match undesirable events. To create more secure rules, make sure that
// contains an account field with a specific account ID from which to receive // the event pattern for each rule contains an account field with a specific
// events. Rules with an account field do not match any events sent from other // account ID from which to receive events. Rules with an account field do not
// accounts. // match any events sent from other accounts.
// //
// Principal is a required field // Principal is a required field
Principal *string `min:"1" type:"string" required:"true"` Principal *string `min:"1" type:"string" required:"true"`
@ -2806,6 +2990,11 @@ func (s *PutPermissionInput) Validate() error {
if s.StatementId != nil && len(*s.StatementId) < 1 { if s.StatementId != nil && len(*s.StatementId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StatementId", 1)) invalidParams.Add(request.NewErrParamMinLen("StatementId", 1))
} }
if s.Condition != nil {
if err := s.Condition.Validate(); err != nil {
invalidParams.AddNested("Condition", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 { if invalidParams.Len() > 0 {
return invalidParams return invalidParams
@ -2819,6 +3008,12 @@ func (s *PutPermissionInput) SetAction(v string) *PutPermissionInput {
return s return s
} }
// SetCondition sets the Condition field's value.
func (s *PutPermissionInput) SetCondition(v *Condition) *PutPermissionInput {
s.Condition = v
return s
}
// SetPrincipal sets the Principal field's value. // SetPrincipal sets the Principal field's value.
func (s *PutPermissionInput) SetPrincipal(v string) *PutPermissionInput { func (s *PutPermissionInput) SetPrincipal(v string) *PutPermissionInput {
s.Principal = &v s.Principal = &v
@ -3161,6 +3356,13 @@ func (s RemovePermissionOutput) GoString() string {
type RemoveTargetsInput struct { type RemoveTargetsInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// If this is a managed rule, created by an AWS service on your behalf, you
// must specify Force as True to remove targets. This parameter is ignored for
// rules that are not managed rules. You can check whether a rule is a managed
// rule by using DescribeRule or ListRules and checking the ManagedBy field
// of the response.
Force *bool `type:"boolean"`
// The IDs of the targets to remove from the rule. // The IDs of the targets to remove from the rule.
// //
// Ids is a required field // Ids is a required field
@ -3204,6 +3406,12 @@ func (s *RemoveTargetsInput) Validate() error {
return nil return nil
} }
// SetForce sets the Force field's value.
func (s *RemoveTargetsInput) SetForce(v bool) *RemoveTargetsInput {
s.Force = &v
return s
}
// SetIds sets the Ids field's value. // SetIds sets the Ids field's value.
func (s *RemoveTargetsInput) SetIds(v []*string) *RemoveTargetsInput { func (s *RemoveTargetsInput) SetIds(v []*string) *RemoveTargetsInput {
s.Ids = v s.Ids = v
@ -3307,6 +3515,10 @@ type Rule struct {
// in the Amazon CloudWatch Events User Guide. // in the Amazon CloudWatch Events User Guide.
EventPattern *string `type:"string"` EventPattern *string `type:"string"`
// If the rule was created on behalf of your account by an AWS service, this
// field displays the principal name of the service that created the rule.
ManagedBy *string `min:"1" type:"string"`
// The name of the rule. // The name of the rule.
Name *string `min:"1" type:"string"` Name *string `min:"1" type:"string"`
@ -3348,6 +3560,12 @@ func (s *Rule) SetEventPattern(v string) *Rule {
return s return s
} }
// SetManagedBy sets the ManagedBy field's value.
func (s *Rule) SetManagedBy(v string) *Rule {
s.ManagedBy = &v
return s
}
// SetName sets the Name field's value. // SetName sets the Name field's value.
func (s *Rule) SetName(v string) *Rule { func (s *Rule) SetName(v string) *Rule {
s.Name = &v s.Name = &v
@ -3515,6 +3733,13 @@ func (s *SqsParameters) SetMessageGroupId(v string) *SqsParameters {
// Targets are the resources to be invoked when a rule is triggered. For a complete // Targets are the resources to be invoked when a rule is triggered. For a complete
// list of services and resources that can be set as a target, see PutTargets. // list of services and resources that can be set as a target, see PutTargets.
//
// If you are setting the event bus of another account as the target, and that
// account granted permission to your account through an organization instead
// of directly by the account ID, then you must specify a RoleArn with proper
// permissions in the Target structure. For more information, see Sending and
// Receiving Events Between AWS Accounts (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEvents-CrossAccountEventDelivery.html)
// in the Amazon CloudWatch Events User Guide.
type Target struct { type Target struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`

View File

@ -7,7 +7,7 @@
// resources. When your resources change state, they automatically send events // resources. When your resources change state, they automatically send events
// into an event stream. You can create rules that match selected events in // into an event stream. You can create rules that match selected events in
// the stream and route them to targets to take action. You can also use rules // the stream and route them to targets to take action. You can also use rules
// to take action on a pre-determined schedule. For example, you can configure // to take action on a predetermined schedule. For example, you can configure
// rules to: // rules to:
// //
// * Automatically invoke an AWS Lambda function to update DNS entries when // * Automatically invoke an AWS Lambda function to update DNS entries when

View File

@ -28,6 +28,16 @@ const (
// You tried to create more rules or add more targets to a rule than is allowed. // You tried to create more rules or add more targets to a rule than is allowed.
ErrCodeLimitExceededException = "LimitExceededException" ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeManagedRuleException for service response error code
// "ManagedRuleException".
//
// This rule was created by an AWS service on behalf of your account. It is
// managed by that service. If you see this error in response to DeleteRule
// or RemoveTargets, you can use the Force parameter in those calls to delete
// the rule or remove targets from the rule. You cannot modify these managed
// rules by using DisableRule, EnableRule, PutTargets, or PutRule.
ErrCodeManagedRuleException = "ManagedRuleException"
// ErrCodePolicyLengthExceededException for service response error code // ErrCodePolicyLengthExceededException for service response error code
// "PolicyLengthExceededException". // "PolicyLengthExceededException".
// //

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,16 @@ const (
// You have reached the maximum number of resources that can be created. // You have reached the maximum number of resources that can be created.
ErrCodeLimitExceededException = "LimitExceededException" ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeMalformedQueryException for service response error code
// "MalformedQueryException".
//
// The query string is not valid. Details about this error are displayed in
// a QueryCompileError object. For more information, see .
//
// For more information about valid query syntax, see CloudWatch Logs Insights
// Query Syntax (http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html).
ErrCodeMalformedQueryException = "MalformedQueryException"
// ErrCodeOperationAbortedException for service response error code // ErrCodeOperationAbortedException for service response error code
// "OperationAbortedException". // "OperationAbortedException".
// //

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
// for the most popular programming languages and build tools, such as Apache // for the most popular programming languages and build tools, such as Apache
// Maven, Gradle, and more. You can also fully customize build environments // Maven, Gradle, and more. You can also fully customize build environments
// in AWS CodeBuild to use your own build tools. AWS CodeBuild scales automatically // in AWS CodeBuild to use your own build tools. AWS CodeBuild scales automatically
// to meet peak build requests, and you pay only for the build time you consume. // to meet peak build requests. You pay only for the build time you consume.
// For more information about AWS CodeBuild, see the AWS CodeBuild User Guide. // For more information about AWS CodeBuild, see the AWS CodeBuild User Guide.
// //
// AWS CodeBuild supports these operations: // AWS CodeBuild supports these operations:
@ -18,19 +18,18 @@
// * BatchDeleteBuilds: Deletes one or more builds. // * BatchDeleteBuilds: Deletes one or more builds.
// //
// * BatchGetProjects: Gets information about one or more build projects. // * BatchGetProjects: Gets information about one or more build projects.
// A build project defines how AWS CodeBuild will run a build. This includes // A build project defines how AWS CodeBuild runs a build. This includes
// information such as where to get the source code to build, the build environment // information such as where to get the source code to build, the build environment
// to use, the build commands to run, and where to store the build output. // to use, the build commands to run, and where to store the build output.
// A build environment represents a combination of operating system, programming // A build environment is a representation of operating system, programming
// language runtime, and tools that AWS CodeBuild will use to run a build. // language runtime, and tools that AWS CodeBuild uses to run a build. You
// Also, you can add tags to build projects to help manage your resources // can add tags to build projects to help manage your resources and costs.
// and costs.
// //
// * CreateProject: Creates a build project. // * CreateProject: Creates a build project.
// //
// * CreateWebhook: For an existing AWS CodeBuild build project that has // * CreateWebhook: For an existing AWS CodeBuild build project that has
// its source code stored in a GitHub repository, enables AWS CodeBuild to // its source code stored in a GitHub or Bitbucket repository, enables AWS
// begin automatically rebuilding the source code every time a code change // CodeBuild to start rebuilding the source code every time a code change
// is pushed to the repository. // is pushed to the repository.
// //
// * UpdateWebhook: Changes the settings of an existing webhook. // * UpdateWebhook: Changes the settings of an existing webhook.
@ -38,9 +37,9 @@
// * DeleteProject: Deletes a build project. // * DeleteProject: Deletes a build project.
// //
// * DeleteWebhook: For an existing AWS CodeBuild build project that has // * DeleteWebhook: For an existing AWS CodeBuild build project that has
// its source code stored in a GitHub repository, stops AWS CodeBuild from // its source code stored in a GitHub or Bitbucket repository, stops AWS
// automatically rebuilding the source code every time a code change is pushed // CodeBuild from rebuilding the source code every time a code change is
// to the repository. // pushed to the repository.
// //
// * ListProjects: Gets a list of build project names, with each build project // * ListProjects: Gets a list of build project names, with each build project
// name representing a single build project. // name representing a single build project.
@ -62,6 +61,17 @@
// * ListCuratedEnvironmentImages: Gets information about Docker images that // * ListCuratedEnvironmentImages: Gets information about Docker images that
// are managed by AWS CodeBuild. // are managed by AWS CodeBuild.
// //
// * DeleteSourceCredentials: Deletes a set of GitHub, GitHub Enterprise,
// or Bitbucket source credentials.
//
// * ImportSourceCredentials: Imports the source repository credentials for
// an AWS CodeBuild project that has its source code stored in a GitHub,
// GitHub Enterprise, or Bitbucket repository.
//
// * ListSourceCredentials: Returns a list of SourceCredentialsInfo objects.
// Each SourceCredentialsInfo object includes the authentication type, token
// ARN, and type of source provider for one set of credentials.
//
// See https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06 for more information on this service. // See https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06 for more information on this service.
// //
// See codebuild package documentation for more information. // See codebuild package documentation for more information.

View File

@ -163,8 +163,7 @@ func (c *CodeCommit) CreateBranchRequest(input *CreateBranchInput) (req *request
output = &CreateBranchOutput{} output = &CreateBranchOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4581,8 +4580,7 @@ func (c *CodeCommit) UpdateDefaultBranchRequest(input *UpdateDefaultBranchInput)
output = &UpdateDefaultBranchOutput{} output = &UpdateDefaultBranchOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -5007,8 +5005,7 @@ func (c *CodeCommit) UpdateRepositoryDescriptionRequest(input *UpdateRepositoryD
output = &UpdateRepositoryDescriptionOutput{} output = &UpdateRepositoryDescriptionOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -5122,8 +5119,7 @@ func (c *CodeCommit) UpdateRepositoryNameRequest(input *UpdateRepositoryNameInpu
output = &UpdateRepositoryNameOutput{} output = &UpdateRepositoryNameOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }

File diff suppressed because it is too large Load Diff

View File

@ -141,12 +141,40 @@ const (
// The specified deployment has not started. // The specified deployment has not started.
ErrCodeDeploymentNotStartedException = "DeploymentNotStartedException" ErrCodeDeploymentNotStartedException = "DeploymentNotStartedException"
// ErrCodeDeploymentTargetDoesNotExistException for service response error code
// "DeploymentTargetDoesNotExistException".
//
// The provided target ID does not belong to the attempted deployment.
ErrCodeDeploymentTargetDoesNotExistException = "DeploymentTargetDoesNotExistException"
// ErrCodeDeploymentTargetIdRequiredException for service response error code
// "DeploymentTargetIdRequiredException".
//
// A deployment target ID was not provided.
ErrCodeDeploymentTargetIdRequiredException = "DeploymentTargetIdRequiredException"
// ErrCodeDeploymentTargetListSizeExceededException for service response error code
// "DeploymentTargetListSizeExceededException".
//
// The maximum number of targets that can be associated with an Amazon ECS or
// AWS Lambda deployment was exceeded. The target list of both types of deployments
// must have exactly one item. This exception does not apply to EC2/On-premises
// deployments.
ErrCodeDeploymentTargetListSizeExceededException = "DeploymentTargetListSizeExceededException"
// ErrCodeDescriptionTooLongException for service response error code // ErrCodeDescriptionTooLongException for service response error code
// "DescriptionTooLongException". // "DescriptionTooLongException".
// //
// The description is too long. // The description is too long.
ErrCodeDescriptionTooLongException = "DescriptionTooLongException" ErrCodeDescriptionTooLongException = "DescriptionTooLongException"
// ErrCodeECSServiceMappingLimitExceededException for service response error code
// "ECSServiceMappingLimitExceededException".
//
// The Amazon ECS service is associated with more than one deployment groups.
// An ECS service can only be associated with one deployment group.
ErrCodeECSServiceMappingLimitExceededException = "ECSServiceMappingLimitExceededException"
// ErrCodeGitHubAccountTokenDoesNotExistException for service response error code // ErrCodeGitHubAccountTokenDoesNotExistException for service response error code
// "GitHubAccountTokenDoesNotExistException". // "GitHubAccountTokenDoesNotExistException".
// //
@ -323,6 +351,18 @@ const (
// and "WITHOUT_TRAFFIC_CONTROL". // and "WITHOUT_TRAFFIC_CONTROL".
ErrCodeInvalidDeploymentStyleException = "InvalidDeploymentStyleException" ErrCodeInvalidDeploymentStyleException = "InvalidDeploymentStyleException"
// ErrCodeInvalidDeploymentTargetIdException for service response error code
// "InvalidDeploymentTargetIdException".
//
// The target ID provide was not valid.
ErrCodeInvalidDeploymentTargetIdException = "InvalidDeploymentTargetIdException"
// ErrCodeInvalidDeploymentWaitTypeException for service response error code
// "InvalidDeploymentWaitTypeException".
//
// The wait type is invalid.
ErrCodeInvalidDeploymentWaitTypeException = "InvalidDeploymentWaitTypeException"
// ErrCodeInvalidEC2TagCombinationException for service response error code // ErrCodeInvalidEC2TagCombinationException for service response error code
// "InvalidEC2TagCombinationException". // "InvalidEC2TagCombinationException".
// //
@ -336,6 +376,12 @@ const (
// The tag was specified in an invalid format. // The tag was specified in an invalid format.
ErrCodeInvalidEC2TagException = "InvalidEC2TagException" ErrCodeInvalidEC2TagException = "InvalidEC2TagException"
// ErrCodeInvalidECSServiceException for service response error code
// "InvalidECSServiceException".
//
// The Amazon ECS service identifier is not valid.
ErrCodeInvalidECSServiceException = "InvalidECSServiceException"
// ErrCodeInvalidFileExistsBehaviorException for service response error code // ErrCodeInvalidFileExistsBehaviorException for service response error code
// "InvalidFileExistsBehaviorException". // "InvalidFileExistsBehaviorException".
// //
@ -498,6 +544,18 @@ const (
// The specified tag filter was specified in an invalid format. // The specified tag filter was specified in an invalid format.
ErrCodeInvalidTagFilterException = "InvalidTagFilterException" ErrCodeInvalidTagFilterException = "InvalidTagFilterException"
// ErrCodeInvalidTargetFilterNameException for service response error code
// "InvalidTargetFilterNameException".
//
// The target filter name is invalid.
ErrCodeInvalidTargetFilterNameException = "InvalidTargetFilterNameException"
// ErrCodeInvalidTargetGroupPairException for service response error code
// "InvalidTargetGroupPairException".
//
// A target group pair associated with this deployment is not valid.
ErrCodeInvalidTargetGroupPairException = "InvalidTargetGroupPairException"
// ErrCodeInvalidTargetInstancesException for service response error code // ErrCodeInvalidTargetInstancesException for service response error code
// "InvalidTargetInstancesException". // "InvalidTargetInstancesException".
// //

View File

@ -409,8 +409,7 @@ func (c *CodePipeline) DeleteCustomActionTypeRequest(input *DeleteCustomActionTy
output = &DeleteCustomActionTypeOutput{} output = &DeleteCustomActionTypeOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -497,8 +496,7 @@ func (c *CodePipeline) DeletePipelineRequest(input *DeletePipelineInput) (req *r
output = &DeletePipelineOutput{} output = &DeletePipelineOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -578,6 +576,7 @@ func (c *CodePipeline) DeleteWebhookRequest(input *DeleteWebhookInput) (req *req
output = &DeleteWebhookOutput{} output = &DeleteWebhookOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -661,6 +660,7 @@ func (c *CodePipeline) DeregisterWebhookWithThirdPartyRequest(input *DeregisterW
output = &DeregisterWebhookWithThirdPartyOutput{} output = &DeregisterWebhookWithThirdPartyOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -745,8 +745,7 @@ func (c *CodePipeline) DisableStageTransitionRequest(input *DisableStageTransiti
output = &DisableStageTransitionOutput{} output = &DisableStageTransitionOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -833,8 +832,7 @@ func (c *CodePipeline) EnableStageTransitionRequest(input *EnableStageTransition
output = &EnableStageTransitionOutput{} output = &EnableStageTransitionOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2058,8 +2056,7 @@ func (c *CodePipeline) PutJobFailureResultRequest(input *PutJobFailureResultInpu
output = &PutJobFailureResultOutput{} output = &PutJobFailureResultOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2146,8 +2143,7 @@ func (c *CodePipeline) PutJobSuccessResultRequest(input *PutJobSuccessResultInpu
output = &PutJobSuccessResultOutput{} output = &PutJobSuccessResultOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2234,8 +2230,7 @@ func (c *CodePipeline) PutThirdPartyJobFailureResultRequest(input *PutThirdParty
output = &PutThirdPartyJobFailureResultOutput{} output = &PutThirdPartyJobFailureResultOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2325,8 +2320,7 @@ func (c *CodePipeline) PutThirdPartyJobSuccessResultRequest(input *PutThirdParty
output = &PutThirdPartyJobSuccessResultOutput{} output = &PutThirdPartyJobSuccessResultOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2515,6 +2509,7 @@ func (c *CodePipeline) RegisterWebhookWithThirdPartyRequest(input *RegisterWebho
output = &RegisterWebhookWithThirdPartyOutput{} output = &RegisterWebhookWithThirdPartyOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2840,7 +2835,7 @@ func (c *CodePipeline) UpdatePipelineWithContext(ctx aws.Context, input *UpdateP
// used to access input and output artifacts in the Amazon S3 bucket used to // used to access input and output artifacts in the Amazon S3 bucket used to
// store artifact for the pipeline in AWS CodePipeline. // store artifact for the pipeline in AWS CodePipeline.
type AWSSessionCredentials struct { type AWSSessionCredentials struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure" sensitive:"true"`
// The access key for the session. // The access key for the session.
// //
@ -3273,6 +3268,9 @@ type ActionDeclaration struct {
// build artifact. // build artifact.
OutputArtifacts []*OutputArtifact `locationName:"outputArtifacts" type:"list"` OutputArtifacts []*OutputArtifact `locationName:"outputArtifacts" type:"list"`
// The action declaration's AWS Region, such as us-east-1.
Region *string `locationName:"region" min:"4" type:"string"`
// The ARN of the IAM service role that will perform the declared action. This // The ARN of the IAM service role that will perform the declared action. This
// is assumed through the roleArn for the pipeline. // is assumed through the roleArn for the pipeline.
RoleArn *string `locationName:"roleArn" type:"string"` RoleArn *string `locationName:"roleArn" type:"string"`
@ -3303,6 +3301,9 @@ func (s *ActionDeclaration) Validate() error {
if s.Name != nil && len(*s.Name) < 1 { if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1)) invalidParams.Add(request.NewErrParamMinLen("Name", 1))
} }
if s.Region != nil && len(*s.Region) < 4 {
invalidParams.Add(request.NewErrParamMinLen("Region", 4))
}
if s.RunOrder != nil && *s.RunOrder < 1 { if s.RunOrder != nil && *s.RunOrder < 1 {
invalidParams.Add(request.NewErrParamMinValue("RunOrder", 1)) invalidParams.Add(request.NewErrParamMinValue("RunOrder", 1))
} }
@ -3368,6 +3369,12 @@ func (s *ActionDeclaration) SetOutputArtifacts(v []*OutputArtifact) *ActionDecla
return s return s
} }
// SetRegion sets the Region field's value.
func (s *ActionDeclaration) SetRegion(v string) *ActionDeclaration {
s.Region = &v
return s
}
// SetRoleArn sets the RoleArn field's value. // SetRoleArn sets the RoleArn field's value.
func (s *ActionDeclaration) SetRoleArn(v string) *ActionDeclaration { func (s *ActionDeclaration) SetRoleArn(v string) *ActionDeclaration {
s.RoleArn = &v s.RoleArn = &v
@ -5794,7 +5801,7 @@ type JobData struct {
// credentials that are issued by AWS Secure Token Service (STS). They can be // credentials that are issued by AWS Secure Token Service (STS). They can be
// used to access input and output artifacts in the Amazon S3 bucket used to // used to access input and output artifacts in the Amazon S3 bucket used to
// store artifact for the pipeline in AWS CodePipeline. // store artifact for the pipeline in AWS CodePipeline.
ArtifactCredentials *AWSSessionCredentials `locationName:"artifactCredentials" type:"structure"` ArtifactCredentials *AWSSessionCredentials `locationName:"artifactCredentials" type:"structure" sensitive:"true"`
// A system-generated token, such as a AWS CodeDeploy deployment ID, that a // A system-generated token, such as a AWS CodeDeploy deployment ID, that a
// job requires in order to continue the job asynchronously. // job requires in order to continue the job asynchronously.
@ -6440,9 +6447,15 @@ type PipelineDeclaration struct {
// Represents information about the Amazon S3 bucket where artifacts are stored // Represents information about the Amazon S3 bucket where artifacts are stored
// for the pipeline. // for the pipeline.
ArtifactStore *ArtifactStore `locationName:"artifactStore" type:"structure"`
// A mapping of artifactStore objects and their corresponding regions. There
// must be an artifact store for the pipeline region and for each cross-region
// action within the pipeline. You can only use either artifactStore or artifactStores,
// not both.
// //
// ArtifactStore is a required field // If you create a cross-region action in your pipeline, you must use artifactStores.
ArtifactStore *ArtifactStore `locationName:"artifactStore" type:"structure" required:"true"` ArtifactStores map[string]*ArtifactStore `locationName:"artifactStores" type:"map"`
// The name of the action to be performed. // The name of the action to be performed.
// //
@ -6479,9 +6492,6 @@ func (s PipelineDeclaration) GoString() string {
// Validate inspects the fields of the type to determine if they are valid. // Validate inspects the fields of the type to determine if they are valid.
func (s *PipelineDeclaration) Validate() error { func (s *PipelineDeclaration) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PipelineDeclaration"} invalidParams := request.ErrInvalidParams{Context: "PipelineDeclaration"}
if s.ArtifactStore == nil {
invalidParams.Add(request.NewErrParamRequired("ArtifactStore"))
}
if s.Name == nil { if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name")) invalidParams.Add(request.NewErrParamRequired("Name"))
} }
@ -6502,6 +6512,16 @@ func (s *PipelineDeclaration) Validate() error {
invalidParams.AddNested("ArtifactStore", err.(request.ErrInvalidParams)) invalidParams.AddNested("ArtifactStore", err.(request.ErrInvalidParams))
} }
} }
if s.ArtifactStores != nil {
for i, v := range s.ArtifactStores {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ArtifactStores", i), err.(request.ErrInvalidParams))
}
}
}
if s.Stages != nil { if s.Stages != nil {
for i, v := range s.Stages { for i, v := range s.Stages {
if v == nil { if v == nil {
@ -6525,6 +6545,12 @@ func (s *PipelineDeclaration) SetArtifactStore(v *ArtifactStore) *PipelineDeclar
return s return s
} }
// SetArtifactStores sets the ArtifactStores field's value.
func (s *PipelineDeclaration) SetArtifactStores(v map[string]*ArtifactStore) *PipelineDeclaration {
s.ArtifactStores = v
return s
}
// SetName sets the Name field's value. // SetName sets the Name field's value.
func (s *PipelineDeclaration) SetName(v string) *PipelineDeclaration { func (s *PipelineDeclaration) SetName(v string) *PipelineDeclaration {
s.Name = &v s.Name = &v
@ -6630,6 +6656,7 @@ type PipelineExecutionSummary struct {
// The ID of the pipeline execution. // The ID of the pipeline execution.
PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string"` PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string"`
// A list of the source artifact revisions that initiated a pipeline execution.
SourceRevisions []*SourceRevision `locationName:"sourceRevisions" type:"list"` SourceRevisions []*SourceRevision `locationName:"sourceRevisions" type:"list"`
// The date and time when the pipeline execution began, in timestamp format. // The date and time when the pipeline execution began, in timestamp format.
@ -7880,16 +7907,29 @@ func (s *S3ArtifactLocation) SetObjectKey(v string) *S3ArtifactLocation {
return s return s
} }
// Information about the version (or revision) of a source artifact that initiated
// a pipeline execution.
type SourceRevision struct { type SourceRevision struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The name of the action that processed the revision to the source artifact.
//
// ActionName is a required field // ActionName is a required field
ActionName *string `locationName:"actionName" min:"1" type:"string" required:"true"` ActionName *string `locationName:"actionName" min:"1" type:"string" required:"true"`
// The system-generated unique ID that identifies the revision number of the
// artifact.
RevisionId *string `locationName:"revisionId" min:"1" type:"string"` RevisionId *string `locationName:"revisionId" min:"1" type:"string"`
// Summary information about the most recent revision of the artifact. For GitHub
// and AWS CodeCommit repositories, the commit message. For Amazon S3 buckets
// or actions, the user-provided content of a codepipeline-artifact-revision-summary
// key specified in the object metadata.
RevisionSummary *string `locationName:"revisionSummary" min:"1" type:"string"` RevisionSummary *string `locationName:"revisionSummary" min:"1" type:"string"`
// The commit ID for the artifact revision. For artifacts stored in GitHub or
// AWS CodeCommit repositories, the commit ID is linked to a commit details
// page.
RevisionUrl *string `locationName:"revisionUrl" min:"1" type:"string"` RevisionUrl *string `locationName:"revisionUrl" min:"1" type:"string"`
} }
@ -8130,6 +8170,9 @@ func (s *StageState) SetStageName(v string) *StageState {
type StartPipelineExecutionInput struct { type StartPipelineExecutionInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The system-generated unique ID used to identify a unique execution request.
ClientRequestToken *string `locationName:"clientRequestToken" min:"1" type:"string" idempotencyToken:"true"`
// The name of the pipeline to start. // The name of the pipeline to start.
// //
// Name is a required field // Name is a required field
@ -8149,6 +8192,9 @@ func (s StartPipelineExecutionInput) GoString() string {
// Validate inspects the fields of the type to determine if they are valid. // Validate inspects the fields of the type to determine if they are valid.
func (s *StartPipelineExecutionInput) Validate() error { func (s *StartPipelineExecutionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StartPipelineExecutionInput"} invalidParams := request.ErrInvalidParams{Context: "StartPipelineExecutionInput"}
if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1))
}
if s.Name == nil { if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name")) invalidParams.Add(request.NewErrParamRequired("Name"))
} }
@ -8162,6 +8208,12 @@ func (s *StartPipelineExecutionInput) Validate() error {
return nil return nil
} }
// SetClientRequestToken sets the ClientRequestToken field's value.
func (s *StartPipelineExecutionInput) SetClientRequestToken(v string) *StartPipelineExecutionInput {
s.ClientRequestToken = &v
return s
}
// SetName sets the Name field's value. // SetName sets the Name field's value.
func (s *StartPipelineExecutionInput) SetName(v string) *StartPipelineExecutionInput { func (s *StartPipelineExecutionInput) SetName(v string) *StartPipelineExecutionInput {
s.Name = &v s.Name = &v
@ -8241,7 +8293,7 @@ type ThirdPartyJobData struct {
// credentials that are issued by AWS Secure Token Service (STS). They can be // credentials that are issued by AWS Secure Token Service (STS). They can be
// used to access input and output artifacts in the Amazon S3 bucket used to // used to access input and output artifacts in the Amazon S3 bucket used to
// store artifact for the pipeline in AWS CodePipeline. // store artifact for the pipeline in AWS CodePipeline.
ArtifactCredentials *AWSSessionCredentials `locationName:"artifactCredentials" type:"structure"` ArtifactCredentials *AWSSessionCredentials `locationName:"artifactCredentials" type:"structure" sensitive:"true"`
// A system-generated token, such as a AWS CodeDeploy deployment ID, that a // A system-generated token, such as a AWS CodeDeploy deployment ID, that a
// job requires in order to continue the job asynchronously. // job requires in order to continue the job asynchronously.
@ -8491,11 +8543,17 @@ func (s *UpdatePipelineOutput) SetPipeline(v *PipelineDeclaration) *UpdatePipeli
return s return s
} }
// The authentication applied to incoming webhook trigger requests.
type WebhookAuthConfiguration struct { type WebhookAuthConfiguration struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The property used to configure acceptance of webhooks within a specific IP
// range. For IP, only the AllowedIPRange property must be set, and this property
// must be set to a valid CIDR range.
AllowedIPRange *string `min:"1" type:"string"` AllowedIPRange *string `min:"1" type:"string"`
// The property used to configure GitHub authentication. For GITHUB_HMAC, only
// the SecretToken property must be set.
SecretToken *string `min:"1" type:"string"` SecretToken *string `min:"1" type:"string"`
} }

View File

@ -249,8 +249,7 @@ func (c *CognitoIdentity) DeleteIdentityPoolRequest(input *DeleteIdentityPoolInp
output = &DeleteIdentityPoolOutput{} output = &DeleteIdentityPoolOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1463,8 +1462,7 @@ func (c *CognitoIdentity) SetIdentityPoolRolesRequest(input *SetIdentityPoolRole
output = &SetIdentityPoolRolesOutput{} output = &SetIdentityPoolRolesOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1567,8 +1565,7 @@ func (c *CognitoIdentity) UnlinkDeveloperIdentityRequest(input *UnlinkDeveloperI
output = &UnlinkDeveloperIdentityOutput{} output = &UnlinkDeveloperIdentityOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1670,8 +1667,7 @@ func (c *CognitoIdentity) UnlinkIdentityRequest(input *UnlinkIdentityInput) (req
output = &UnlinkIdentityOutput{} output = &UnlinkIdentityOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }

View File

@ -53,6 +53,7 @@ func (c *CognitoIdentityProvider) AddCustomAttributesRequest(input *AddCustomAtt
output = &AddCustomAttributesOutput{} output = &AddCustomAttributesOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -151,8 +152,7 @@ func (c *CognitoIdentityProvider) AdminAddUserToGroupRequest(input *AdminAddUser
output = &AdminAddUserToGroupOutput{} output = &AdminAddUserToGroupOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -252,6 +252,7 @@ func (c *CognitoIdentityProvider) AdminConfirmSignUpRequest(input *AdminConfirmS
output = &AdminConfirmSignUpOutput{} output = &AdminConfirmSignUpOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -523,8 +524,7 @@ func (c *CognitoIdentityProvider) AdminDeleteUserRequest(input *AdminDeleteUserI
output = &AdminDeleteUserOutput{} output = &AdminDeleteUserOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -624,6 +624,7 @@ func (c *CognitoIdentityProvider) AdminDeleteUserAttributesRequest(input *AdminD
output = &AdminDeleteUserAttributesOutput{} output = &AdminDeleteUserAttributesOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -724,6 +725,7 @@ func (c *CognitoIdentityProvider) AdminDisableProviderForUserRequest(input *Admi
output = &AdminDisableProviderForUserOutput{} output = &AdminDisableProviderForUserOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -855,6 +857,7 @@ func (c *CognitoIdentityProvider) AdminDisableUserRequest(input *AdminDisableUse
output = &AdminDisableUserOutput{} output = &AdminDisableUserOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -954,6 +957,7 @@ func (c *CognitoIdentityProvider) AdminEnableUserRequest(input *AdminEnableUserI
output = &AdminEnableUserOutput{} output = &AdminEnableUserOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1053,8 +1057,7 @@ func (c *CognitoIdentityProvider) AdminForgetDeviceRequest(input *AdminForgetDev
output = &AdminForgetDeviceOutput{} output = &AdminForgetDeviceOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1490,6 +1493,7 @@ func (c *CognitoIdentityProvider) AdminLinkProviderForUserRequest(input *AdminLi
output = &AdminLinkProviderForUserOutput{} output = &AdminLinkProviderForUserOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1910,8 +1914,7 @@ func (c *CognitoIdentityProvider) AdminRemoveUserFromGroupRequest(input *AdminRe
output = &AdminRemoveUserFromGroupOutput{} output = &AdminRemoveUserFromGroupOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2011,6 +2014,7 @@ func (c *CognitoIdentityProvider) AdminResetUserPasswordRequest(input *AdminRese
output = &AdminResetUserPasswordOutput{} output = &AdminResetUserPasswordOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2306,6 +2310,7 @@ func (c *CognitoIdentityProvider) AdminSetUserMFAPreferenceRequest(input *AdminS
output = &AdminSetUserMFAPreferenceOutput{} output = &AdminSetUserMFAPreferenceOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2405,6 +2410,7 @@ func (c *CognitoIdentityProvider) AdminSetUserSettingsRequest(input *AdminSetUse
output = &AdminSetUserSettingsOutput{} output = &AdminSetUserSettingsOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2500,6 +2506,7 @@ func (c *CognitoIdentityProvider) AdminUpdateAuthEventFeedbackRequest(input *Adm
output = &AdminUpdateAuthEventFeedbackOutput{} output = &AdminUpdateAuthEventFeedbackOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2602,6 +2609,7 @@ func (c *CognitoIdentityProvider) AdminUpdateDeviceStatusRequest(input *AdminUpd
output = &AdminUpdateDeviceStatusOutput{} output = &AdminUpdateDeviceStatusOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2704,6 +2712,7 @@ func (c *CognitoIdentityProvider) AdminUpdateUserAttributesRequest(input *AdminU
output = &AdminUpdateUserAttributesOutput{} output = &AdminUpdateUserAttributesOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -2828,6 +2837,7 @@ func (c *CognitoIdentityProvider) AdminUserGlobalSignOutRequest(input *AdminUser
output = &AdminUserGlobalSignOutOutput{} output = &AdminUserGlobalSignOutOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -3023,6 +3033,7 @@ func (c *CognitoIdentityProvider) ChangePasswordRequest(input *ChangePasswordInp
output = &ChangePasswordOutput{} output = &ChangePasswordOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Config.Credentials = credentials.AnonymousCredentials req.Config.Credentials = credentials.AnonymousCredentials
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -3254,6 +3265,7 @@ func (c *CognitoIdentityProvider) ConfirmForgotPasswordRequest(input *ConfirmFor
output = &ConfirmForgotPasswordOutput{} output = &ConfirmForgotPasswordOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Config.Credentials = credentials.AnonymousCredentials req.Config.Credentials = credentials.AnonymousCredentials
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -3386,6 +3398,7 @@ func (c *CognitoIdentityProvider) ConfirmSignUpRequest(input *ConfirmSignUpInput
output = &ConfirmSignUpOutput{} output = &ConfirmSignUpOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Config.Credentials = credentials.AnonymousCredentials req.Config.Credentials = credentials.AnonymousCredentials
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4232,8 +4245,7 @@ func (c *CognitoIdentityProvider) DeleteGroupRequest(input *DeleteGroupInput) (r
output = &DeleteGroupOutput{} output = &DeleteGroupOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4330,8 +4342,7 @@ func (c *CognitoIdentityProvider) DeleteIdentityProviderRequest(input *DeleteIde
output = &DeleteIdentityProviderOutput{} output = &DeleteIdentityProviderOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4429,8 +4440,7 @@ func (c *CognitoIdentityProvider) DeleteResourceServerRequest(input *DeleteResou
output = &DeleteResourceServerOutput{} output = &DeleteResourceServerOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4525,9 +4535,8 @@ func (c *CognitoIdentityProvider) DeleteUserRequest(input *DeleteUserInput) (req
output = &DeleteUserOutput{} output = &DeleteUserOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
req.Config.Credentials = credentials.AnonymousCredentials req.Config.Credentials = credentials.AnonymousCredentials
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4632,6 +4641,7 @@ func (c *CognitoIdentityProvider) DeleteUserAttributesRequest(input *DeleteUserA
output = &DeleteUserAttributesOutput{} output = &DeleteUserAttributesOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Config.Credentials = credentials.AnonymousCredentials req.Config.Credentials = credentials.AnonymousCredentials
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4735,8 +4745,7 @@ func (c *CognitoIdentityProvider) DeleteUserPoolRequest(input *DeleteUserPoolInp
output = &DeleteUserPoolOutput{} output = &DeleteUserPoolOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4835,8 +4844,7 @@ func (c *CognitoIdentityProvider) DeleteUserPoolClientRequest(input *DeleteUserP
output = &DeleteUserPoolClientOutput{} output = &DeleteUserPoolClientOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4931,6 +4939,7 @@ func (c *CognitoIdentityProvider) DeleteUserPoolDomainRequest(input *DeleteUserP
output = &DeleteUserPoolDomainOutput{} output = &DeleteUserPoolDomainOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -5683,8 +5692,7 @@ func (c *CognitoIdentityProvider) ForgetDeviceRequest(input *ForgetDeviceInput)
output = &ForgetDeviceOutput{} output = &ForgetDeviceOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -6838,6 +6846,7 @@ func (c *CognitoIdentityProvider) GlobalSignOutRequest(input *GlobalSignOutInput
output = &GlobalSignOutOutput{} output = &GlobalSignOutOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -8414,6 +8423,7 @@ func (c *CognitoIdentityProvider) SetUserMFAPreferenceRequest(input *SetUserMFAP
output = &SetUserMFAPreferenceOutput{} output = &SetUserMFAPreferenceOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -8618,6 +8628,7 @@ func (c *CognitoIdentityProvider) SetUserSettingsRequest(input *SetUserSettingsI
output = &SetUserSettingsOutput{} output = &SetUserSettingsOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Config.Credentials = credentials.AnonymousCredentials req.Config.Credentials = credentials.AnonymousCredentials
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -9046,6 +9057,7 @@ func (c *CognitoIdentityProvider) UpdateAuthEventFeedbackRequest(input *UpdateAu
output = &UpdateAuthEventFeedbackOutput{} output = &UpdateAuthEventFeedbackOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -9148,6 +9160,7 @@ func (c *CognitoIdentityProvider) UpdateDeviceStatusRequest(input *UpdateDeviceS
output = &UpdateDeviceStatusOutput{} output = &UpdateDeviceStatusOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -9687,6 +9700,7 @@ func (c *CognitoIdentityProvider) UpdateUserPoolRequest(input *UpdateUserPoolInp
output = &UpdateUserPoolOutput{} output = &UpdateUserPoolOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -10037,6 +10051,7 @@ func (c *CognitoIdentityProvider) VerifyUserAttributeRequest(input *VerifyUserAt
output = &VerifyUserAttributeOutput{} output = &VerifyUserAttributeOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Config.Credentials = credentials.AnonymousCredentials req.Config.Credentials = credentials.AnonymousCredentials
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -10401,7 +10416,7 @@ type AdminAddUserToGroupInput struct {
// The username for the user. // The username for the user.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -10486,7 +10501,7 @@ type AdminConfirmSignUpInput struct {
// The user name for which you want to confirm user registration. // The user name for which you want to confirm user registration.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -10652,7 +10667,7 @@ type AdminCreateUserInput struct {
// limit that you specified when you created the user pool. To reset the account // limit that you specified when you created the user pool. To reset the account
// after that time limit, you must call AdminCreateUser again, specifying "RESEND" // after that time limit, you must call AdminCreateUser again, specifying "RESEND"
// for the MessageAction parameter. // for the MessageAction parameter.
TemporaryPassword *string `min:"6" type:"string"` TemporaryPassword *string `min:"6" type:"string" sensitive:"true"`
// An array of name-value pairs that contain user attributes and attribute values // An array of name-value pairs that contain user attributes and attribute values
// to be set for the user to be created. You can create a user without specifying // to be set for the user to be created. You can create a user without specifying
@ -10694,7 +10709,7 @@ type AdminCreateUserInput struct {
// username cannot be changed. // username cannot be changed.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
// The user's validation data. This is an array of name-value pairs that contain // The user's validation data. This is an array of name-value pairs that contain
// user attributes and attribute values that you can use for custom validation, // user attributes and attribute values that you can use for custom validation,
@ -10858,7 +10873,7 @@ type AdminDeleteUserAttributesInput struct {
// The user name of the user from which you would like to delete attributes. // The user name of the user from which you would like to delete attributes.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -10942,7 +10957,7 @@ type AdminDeleteUserInput struct {
// The user name of the user you wish to delete. // The user name of the user you wish to delete.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -11086,7 +11101,7 @@ type AdminDisableUserInput struct {
// The user name of the user you wish to disable. // The user name of the user you wish to disable.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -11161,7 +11176,7 @@ type AdminEnableUserInput struct {
// The user name of the user you wish to enable. // The user name of the user you wish to enable.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -11241,7 +11256,7 @@ type AdminForgetDeviceInput struct {
// The user name. // The user name.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -11331,7 +11346,7 @@ type AdminGetDeviceInput struct {
// The user name. // The user name.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -11429,7 +11444,7 @@ type AdminGetUserInput struct {
// The user name of the user you wish to retrieve. // The user name of the user you wish to retrieve.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -11518,7 +11533,7 @@ type AdminGetUserOutput struct {
// The user name of the user about whom you are receiving information. // The user name of the user about whom you are receiving information.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -11646,7 +11661,7 @@ type AdminInitiateAuthInput struct {
// The app client ID. // The app client ID.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// This is a random key-value pair map which can contain any key and will be // This is a random key-value pair map which can contain any key and will be
// passed to your PreAuthentication Lambda trigger as-is. It can be used to // passed to your PreAuthentication Lambda trigger as-is. It can be used to
@ -11983,7 +11998,7 @@ type AdminListDevicesInput struct {
// The user name. // The user name.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -12096,7 +12111,7 @@ type AdminListGroupsForUserInput struct {
// The username for the user. // The username for the user.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -12208,7 +12223,7 @@ type AdminListUserAuthEventsInput struct {
// The user pool username or an alias. // The user pool username or an alias.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -12319,7 +12334,7 @@ type AdminRemoveUserFromGroupInput struct {
// The username for the user. // The username for the user.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -12404,7 +12419,7 @@ type AdminResetUserPasswordInput struct {
// The user name of the user whose password you wish to reset. // The user name of the user whose password you wish to reset.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -12505,7 +12520,7 @@ type AdminRespondToAuthChallengeInput struct {
// The app client ID. // The app client ID.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// Contextual data such as the user's device fingerprint, IP address, or location // Contextual data such as the user's device fingerprint, IP address, or location
// used for evaluating the risk of an unexpected event by Amazon Cognito advanced // used for evaluating the risk of an unexpected event by Amazon Cognito advanced
@ -12682,7 +12697,7 @@ type AdminSetUserMFAPreferenceInput struct {
// The user pool username or alias. // The user pool username or alias.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -12773,7 +12788,7 @@ type AdminSetUserSettingsInput struct {
// The user name of the user for whom you wish to set user settings. // The user name of the user for whom you wish to set user settings.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -12875,7 +12890,7 @@ type AdminUpdateAuthEventFeedbackInput struct {
// The user pool username. // The user pool username.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -12977,7 +12992,7 @@ type AdminUpdateDeviceStatusInput struct {
// The user name. // The user name.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -13077,7 +13092,7 @@ type AdminUpdateUserAttributesInput struct {
// The user name of the user for whom you want to update user attributes. // The user name of the user for whom you want to update user attributes.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -13171,7 +13186,7 @@ type AdminUserGlobalSignOutInput struct {
// The user name. // The user name.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -13346,7 +13361,7 @@ type AssociateSoftwareTokenInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The access token. // The access token.
AccessToken *string `type:"string"` AccessToken *string `type:"string" sensitive:"true"`
// The session which should be passed both ways in challenge-response calls // The session which should be passed both ways in challenge-response calls
// to the service. This allows authentication of the user as part of the MFA // to the service. This allows authentication of the user as part of the MFA
@ -13394,7 +13409,7 @@ type AssociateSoftwareTokenOutput struct {
// A unique generated shared secret code that is used in the TOTP algorithm // A unique generated shared secret code that is used in the TOTP algorithm
// to generate a one time code. // to generate a one time code.
SecretCode *string `min:"16" type:"string"` SecretCode *string `min:"16" type:"string" sensitive:"true"`
// The session which should be passed both ways in challenge-response calls // The session which should be passed both ways in challenge-response calls
// to the service. This allows authentication of the user as part of the MFA // to the service. This allows authentication of the user as part of the MFA
@ -13434,7 +13449,7 @@ type AttributeType struct {
Name *string `min:"1" type:"string" required:"true"` Name *string `min:"1" type:"string" required:"true"`
// The value of the attribute. // The value of the attribute.
Value *string `type:"string"` Value *string `type:"string" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -13569,19 +13584,19 @@ type AuthenticationResultType struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The access token. // The access token.
AccessToken *string `type:"string"` AccessToken *string `type:"string" sensitive:"true"`
// The expiration period of the authentication result in seconds. // The expiration period of the authentication result in seconds.
ExpiresIn *int64 `type:"integer"` ExpiresIn *int64 `type:"integer"`
// The ID token. // The ID token.
IdToken *string `type:"string"` IdToken *string `type:"string" sensitive:"true"`
// The new device metadata from an authentication result. // The new device metadata from an authentication result.
NewDeviceMetadata *NewDeviceMetadataType `type:"structure"` NewDeviceMetadata *NewDeviceMetadataType `type:"structure"`
// The refresh token. // The refresh token.
RefreshToken *string `type:"string"` RefreshToken *string `type:"string" sensitive:"true"`
// The token type. // The token type.
TokenType *string `type:"string"` TokenType *string `type:"string"`
@ -13673,17 +13688,17 @@ type ChangePasswordInput struct {
// The access token. // The access token.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// The old password. // The old password.
// //
// PreviousPassword is a required field // PreviousPassword is a required field
PreviousPassword *string `min:"6" type:"string" required:"true"` PreviousPassword *string `min:"6" type:"string" required:"true" sensitive:"true"`
// The new password. // The new password.
// //
// ProposedPassword is a required field // ProposedPassword is a required field
ProposedPassword *string `min:"6" type:"string" required:"true"` ProposedPassword *string `min:"6" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -13896,7 +13911,7 @@ type ConfirmDeviceInput struct {
// The access token. // The access token.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// The device key. // The device key.
// //
@ -14002,7 +14017,7 @@ type ConfirmForgotPasswordInput struct {
// The app client ID of the app associated with the user pool. // The app client ID of the app associated with the user pool.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// The confirmation code sent by a user's request to retrieve a forgotten password. // The confirmation code sent by a user's request to retrieve a forgotten password.
// For more information, see // For more information, see
@ -14013,11 +14028,11 @@ type ConfirmForgotPasswordInput struct {
// The password sent by a user's request to retrieve a forgotten password. // The password sent by a user's request to retrieve a forgotten password.
// //
// Password is a required field // Password is a required field
Password *string `min:"6" type:"string" required:"true"` Password *string `min:"6" type:"string" required:"true" sensitive:"true"`
// A keyed-hash message authentication code (HMAC) calculated using the secret // A keyed-hash message authentication code (HMAC) calculated using the secret
// key of a user pool client and username plus the client ID in the message. // key of a user pool client and username plus the client ID in the message.
SecretHash *string `min:"1" type:"string"` SecretHash *string `min:"1" type:"string" sensitive:"true"`
// Contextual data such as the user's device fingerprint, IP address, or location // Contextual data such as the user's device fingerprint, IP address, or location
// used for evaluating the risk of an unexpected event by Amazon Cognito advanced // used for evaluating the risk of an unexpected event by Amazon Cognito advanced
@ -14028,7 +14043,7 @@ type ConfirmForgotPasswordInput struct {
// forgotten password. // forgotten password.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -14147,7 +14162,7 @@ type ConfirmSignUpInput struct {
// The ID of the app client associated with the user pool. // The ID of the app client associated with the user pool.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// The confirmation code sent by a user's request to confirm registration. // The confirmation code sent by a user's request to confirm registration.
// //
@ -14164,7 +14179,7 @@ type ConfirmSignUpInput struct {
// A keyed-hash message authentication code (HMAC) calculated using the secret // A keyed-hash message authentication code (HMAC) calculated using the secret
// key of a user pool client and username plus the client ID in the message. // key of a user pool client and username plus the client ID in the message.
SecretHash *string `min:"1" type:"string"` SecretHash *string `min:"1" type:"string" sensitive:"true"`
// Contextual data such as the user's device fingerprint, IP address, or location // Contextual data such as the user's device fingerprint, IP address, or location
// used for evaluating the risk of an unexpected event by Amazon Cognito advanced // used for evaluating the risk of an unexpected event by Amazon Cognito advanced
@ -14174,7 +14189,7 @@ type ConfirmSignUpInput struct {
// The user name of the user whose registration you wish to confirm. // The user name of the user whose registration you wish to confirm.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -15767,7 +15782,7 @@ type DeleteUserAttributesInput struct {
// The access token used in the request to delete user attributes. // The access token used in the request to delete user attributes.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// An array of strings representing the user attribute names you wish to delete. // An array of strings representing the user attribute names you wish to delete.
// //
@ -15838,7 +15853,7 @@ type DeleteUserInput struct {
// The access token from a request to delete a user. // The access token from a request to delete a user.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -15891,7 +15906,7 @@ type DeleteUserPoolClientInput struct {
// The app client ID of the app associated with the user pool. // The app client ID of the app associated with the user pool.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// The user pool ID for the user pool where you want to delete the client. // The user pool ID for the user pool where you want to delete the client.
// //
@ -16255,7 +16270,7 @@ type DescribeRiskConfigurationInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The app client ID. // The app client ID.
ClientId *string `min:"1" type:"string"` ClientId *string `min:"1" type:"string" sensitive:"true"`
// The user pool ID. // The user pool ID.
// //
@ -16420,7 +16435,7 @@ type DescribeUserPoolClientInput struct {
// The app client ID of the app associated with the user pool. // The app client ID of the app associated with the user pool.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// The user pool ID for the user pool you want to describe. // The user pool ID for the user pool you want to describe.
// //
@ -17032,7 +17047,7 @@ type ForgetDeviceInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The access token for the forgotten device request. // The access token for the forgotten device request.
AccessToken *string `type:"string"` AccessToken *string `type:"string" sensitive:"true"`
// The device key. // The device key.
// //
@ -17103,11 +17118,11 @@ type ForgotPasswordInput struct {
// The ID of the client associated with the user pool. // The ID of the client associated with the user pool.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// A keyed-hash message authentication code (HMAC) calculated using the secret // A keyed-hash message authentication code (HMAC) calculated using the secret
// key of a user pool client and username plus the client ID in the message. // key of a user pool client and username plus the client ID in the message.
SecretHash *string `min:"1" type:"string"` SecretHash *string `min:"1" type:"string" sensitive:"true"`
// Contextual data such as the user's device fingerprint, IP address, or location // Contextual data such as the user's device fingerprint, IP address, or location
// used for evaluating the risk of an unexpected event by Amazon Cognito advanced // used for evaluating the risk of an unexpected event by Amazon Cognito advanced
@ -17118,7 +17133,7 @@ type ForgotPasswordInput struct {
// password. // password.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -17294,7 +17309,7 @@ type GetDeviceInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The access token. // The access token.
AccessToken *string `type:"string"` AccessToken *string `type:"string" sensitive:"true"`
// The device key. // The device key.
// //
@ -17600,7 +17615,7 @@ type GetUICustomizationInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The client ID for the client app. // The client ID for the client app.
ClientId *string `min:"1" type:"string"` ClientId *string `min:"1" type:"string" sensitive:"true"`
// The user pool ID for the user pool. // The user pool ID for the user pool.
// //
@ -17682,7 +17697,7 @@ type GetUserAttributeVerificationCodeInput struct {
// verification code. // verification code.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// The attribute name returned by the server response to get the user attribute // The attribute name returned by the server response to get the user attribute
// verification code. // verification code.
@ -17766,7 +17781,7 @@ type GetUserInput struct {
// the user. // the user.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -17823,7 +17838,7 @@ type GetUserOutput struct {
// The user name of the user you wish to retrieve from the get user request. // The user name of the user you wish to retrieve from the get user request.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -17955,7 +17970,7 @@ type GlobalSignOutInput struct {
// The access token. // The access token.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -18270,7 +18285,7 @@ type InitiateAuthInput struct {
// The app client ID. // The app client ID.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// This is a random key-value pair map which can contain any key and will be // This is a random key-value pair map which can contain any key and will be
// passed to your PreAuthentication Lambda trigger as-is. It can be used to // passed to your PreAuthentication Lambda trigger as-is. It can be used to
@ -18588,7 +18603,7 @@ type ListDevicesInput struct {
// The access tokens for the request to list devices. // The access tokens for the request to list devices.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// The limit of the device request. // The limit of the device request.
Limit *int64 `type:"integer"` Limit *int64 `type:"integer"`
@ -20081,11 +20096,11 @@ type ResendConfirmationCodeInput struct {
// The ID of the client associated with the user pool. // The ID of the client associated with the user pool.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// A keyed-hash message authentication code (HMAC) calculated using the secret // A keyed-hash message authentication code (HMAC) calculated using the secret
// key of a user pool client and username plus the client ID in the message. // key of a user pool client and username plus the client ID in the message.
SecretHash *string `min:"1" type:"string"` SecretHash *string `min:"1" type:"string" sensitive:"true"`
// Contextual data such as the user's device fingerprint, IP address, or location // Contextual data such as the user's device fingerprint, IP address, or location
// used for evaluating the risk of an unexpected event by Amazon Cognito advanced // used for evaluating the risk of an unexpected event by Amazon Cognito advanced
@ -20095,7 +20110,7 @@ type ResendConfirmationCodeInput struct {
// The user name of the user to whom you wish to resend a confirmation code. // The user name of the user to whom you wish to resend a confirmation code.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -20331,7 +20346,7 @@ type RespondToAuthChallengeInput struct {
// The app client ID. // The app client ID.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// The session which should be passed both ways in challenge-response calls // The session which should be passed both ways in challenge-response calls
// to the service. If InitiateAuth or RespondToAuthChallenge API call determines // to the service. If InitiateAuth or RespondToAuthChallenge API call determines
@ -20479,7 +20494,7 @@ type RiskConfigurationType struct {
AccountTakeoverRiskConfiguration *AccountTakeoverRiskConfigurationType `type:"structure"` AccountTakeoverRiskConfiguration *AccountTakeoverRiskConfigurationType `type:"structure"`
// The app client ID. // The app client ID.
ClientId *string `min:"1" type:"string"` ClientId *string `min:"1" type:"string" sensitive:"true"`
// The compromised credentials risk configuration object including the EventFilter // The compromised credentials risk configuration object including the EventFilter
// and the EventAction // and the EventAction
@ -20716,7 +20731,7 @@ type SetRiskConfigurationInput struct {
// Otherwise, ClientId is mapped to the client. When the client ID is not null, // Otherwise, ClientId is mapped to the client. When the client ID is not null,
// the user pool configuration is overridden and the risk configuration for // the user pool configuration is overridden and the risk configuration for
// the client is used instead. // the client is used instead.
ClientId *string `min:"1" type:"string"` ClientId *string `min:"1" type:"string" sensitive:"true"`
// The compromised credentials risk configuration. // The compromised credentials risk configuration.
CompromisedCredentialsRiskConfiguration *CompromisedCredentialsRiskConfigurationType `type:"structure"` CompromisedCredentialsRiskConfiguration *CompromisedCredentialsRiskConfigurationType `type:"structure"`
@ -20831,7 +20846,7 @@ type SetUICustomizationInput struct {
CSS *string `type:"string"` CSS *string `type:"string"`
// The client ID for the client app. // The client ID for the client app.
ClientId *string `min:"1" type:"string"` ClientId *string `min:"1" type:"string" sensitive:"true"`
// The uploaded logo image for the UI customization. // The uploaded logo image for the UI customization.
// //
@ -20928,7 +20943,7 @@ type SetUserMFAPreferenceInput struct {
// The access token. // The access token.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// The SMS text message multi-factor authentication (MFA) settings. // The SMS text message multi-factor authentication (MFA) settings.
SMSMfaSettings *SMSMfaSettingsType `type:"structure"` SMSMfaSettings *SMSMfaSettingsType `type:"structure"`
@ -21113,7 +21128,7 @@ type SetUserSettingsInput struct {
// The access token for the set user settings request. // The access token for the set user settings request.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// Specifies the options for MFA (e.g., email or phone number). // Specifies the options for MFA (e.g., email or phone number).
// //
@ -21195,16 +21210,16 @@ type SignUpInput struct {
// The ID of the client associated with the user pool. // The ID of the client associated with the user pool.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// The password of the user you wish to register. // The password of the user you wish to register.
// //
// Password is a required field // Password is a required field
Password *string `min:"6" type:"string" required:"true"` Password *string `min:"6" type:"string" required:"true" sensitive:"true"`
// A keyed-hash message authentication code (HMAC) calculated using the secret // A keyed-hash message authentication code (HMAC) calculated using the secret
// key of a user pool client and username plus the client ID in the message. // key of a user pool client and username plus the client ID in the message.
SecretHash *string `min:"1" type:"string"` SecretHash *string `min:"1" type:"string" sensitive:"true"`
// An array of name-value pairs representing user attributes. // An array of name-value pairs representing user attributes.
// //
@ -21220,7 +21235,7 @@ type SignUpInput struct {
// The user name of the user you wish to register. // The user name of the user you wish to register.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
// The validation data in the request to register a user. // The validation data in the request to register a user.
ValidationData []*AttributeType `type:"list"` ValidationData []*AttributeType `type:"list"`
@ -21755,7 +21770,7 @@ type UICustomizationType struct {
CSSVersion *string `type:"string"` CSSVersion *string `type:"string"`
// The client ID for the client app. // The client ID for the client app.
ClientId *string `min:"1" type:"string"` ClientId *string `min:"1" type:"string" sensitive:"true"`
// The creation date for the UI customization. // The creation date for the UI customization.
CreationDate *time.Time `type:"timestamp"` CreationDate *time.Time `type:"timestamp"`
@ -21833,7 +21848,7 @@ type UpdateAuthEventFeedbackInput struct {
// The feedback token. // The feedback token.
// //
// FeedbackToken is a required field // FeedbackToken is a required field
FeedbackToken *string `type:"string" required:"true"` FeedbackToken *string `type:"string" required:"true" sensitive:"true"`
// The authentication event feedback value. // The authentication event feedback value.
// //
@ -21848,7 +21863,7 @@ type UpdateAuthEventFeedbackInput struct {
// The user pool username. // The user pool username.
// //
// Username is a required field // Username is a required field
Username *string `min:"1" type:"string" required:"true"` Username *string `min:"1" type:"string" required:"true" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -21946,7 +21961,7 @@ type UpdateDeviceStatusInput struct {
// The access token. // The access token.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// The device key. // The device key.
// //
@ -22368,7 +22383,7 @@ type UpdateUserAttributesInput struct {
// The access token for the request to update user attributes. // The access token for the request to update user attributes.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// An array of name-value pairs representing user attributes. // An array of name-value pairs representing user attributes.
// //
@ -22497,7 +22512,7 @@ type UpdateUserPoolClientInput struct {
// The ID of the client associated with the user pool. // The ID of the client associated with the user pool.
// //
// ClientId is a required field // ClientId is a required field
ClientId *string `min:"1" type:"string" required:"true"` ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"`
// The client name from the update user pool client request. // The client name from the update user pool client request.
ClientName *string `min:"1" type:"string"` ClientName *string `min:"1" type:"string"`
@ -23185,7 +23200,7 @@ type UserPoolClientDescription struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The ID of the client associated with the user pool. // The ID of the client associated with the user pool.
ClientId *string `min:"1" type:"string"` ClientId *string `min:"1" type:"string" sensitive:"true"`
// The client name from the user pool client description. // The client name from the user pool client description.
ClientName *string `min:"1" type:"string"` ClientName *string `min:"1" type:"string"`
@ -23265,13 +23280,13 @@ type UserPoolClientType struct {
CallbackURLs []*string `type:"list"` CallbackURLs []*string `type:"list"`
// The ID of the client associated with the user pool. // The ID of the client associated with the user pool.
ClientId *string `min:"1" type:"string"` ClientId *string `min:"1" type:"string" sensitive:"true"`
// The client name from the user pool request of the client type. // The client name from the user pool request of the client type.
ClientName *string `min:"1" type:"string"` ClientName *string `min:"1" type:"string"`
// The client secret from the user pool request of the client type. // The client secret from the user pool request of the client type.
ClientSecret *string `min:"1" type:"string"` ClientSecret *string `min:"1" type:"string" sensitive:"true"`
// The date the user pool client was created. // The date the user pool client was created.
CreationDate *time.Time `type:"timestamp"` CreationDate *time.Time `type:"timestamp"`
@ -23865,7 +23880,7 @@ type UserType struct {
UserStatus *string `type:"string" enum:"UserStatusType"` UserStatus *string `type:"string" enum:"UserStatusType"`
// The user name of the user you wish to describe. // The user name of the user you wish to describe.
Username *string `min:"1" type:"string"` Username *string `min:"1" type:"string" sensitive:"true"`
} }
// String returns the string representation // String returns the string representation
@ -24019,7 +24034,7 @@ type VerifySoftwareTokenInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// The access token. // The access token.
AccessToken *string `type:"string"` AccessToken *string `type:"string" sensitive:"true"`
// The friendly device name. // The friendly device name.
FriendlyDeviceName *string `type:"string"` FriendlyDeviceName *string `type:"string"`
@ -24127,7 +24142,7 @@ type VerifyUserAttributeInput struct {
// Represents the access token of the request to verify user attributes. // Represents the access token of the request to verify user attributes.
// //
// AccessToken is a required field // AccessToken is a required field
AccessToken *string `type:"string" required:"true"` AccessToken *string `type:"string" required:"true" sensitive:"true"`
// The attribute name in the request to verify user attributes. // The attribute name in the request to verify user attributes.
// //

File diff suppressed because it is too large Load Diff

View File

@ -212,6 +212,12 @@ const (
// not have all features enabled. // not have all features enabled.
ErrCodeOrganizationAllFeaturesNotEnabledException = "OrganizationAllFeaturesNotEnabledException" ErrCodeOrganizationAllFeaturesNotEnabledException = "OrganizationAllFeaturesNotEnabledException"
// ErrCodeOversizedConfigurationItemException for service response error code
// "OversizedConfigurationItemException".
//
// The configuration item size is outside the allowable range.
ErrCodeOversizedConfigurationItemException = "OversizedConfigurationItemException"
// ErrCodeResourceInUseException for service response error code // ErrCodeResourceInUseException for service response error code
// "ResourceInUseException". // "ResourceInUseException".
// //

View File

@ -9,6 +9,8 @@ import (
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
) )
const opAddTagsToResource = "AddTagsToResource" const opAddTagsToResource = "AddTagsToResource"
@ -50,6 +52,7 @@ func (c *DatabaseMigrationService) AddTagsToResourceRequest(input *AddTagsToReso
output = &AddTagsToResourceOutput{} output = &AddTagsToResourceOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -246,9 +249,9 @@ func (c *DatabaseMigrationService) CreateEventSubscriptionRequest(input *CreateE
// will be notified of events generated from all AWS DMS sources belonging to // will be notified of events generated from all AWS DMS sources belonging to
// your customer account. // your customer account.
// //
// For more information about AWS DMS events, see Working with Events and Notifications // For more information about AWS DMS events, see Working with Events and Notifications
// (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html) in the // (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html) in the
// AWS Database MIgration Service User Guide. // AWS Database Migration Service User Guide.
// //
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about // with awserr.Error's Code and Message methods to get detailed information about
@ -970,6 +973,7 @@ func (c *DatabaseMigrationService) DeleteReplicationSubnetGroupRequest(input *De
output = &DeleteReplicationSubnetGroupOutput{} output = &DeleteReplicationSubnetGroupOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -1758,7 +1762,7 @@ func (c *DatabaseMigrationService) DescribeEventCategoriesRequest(input *Describ
// //
// Lists categories for all event source types, or, if specified, for a specified // Lists categories for all event source types, or, if specified, for a specified
// source type. You can see a list of the event categories and source types // source type. You can see a list of the event categories and source types
// in Working with Events and Notifications (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html) // in Working with Events and Notifications (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html)
// in the AWS Database Migration Service User Guide. // in the AWS Database Migration Service User Guide.
// //
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@ -1981,7 +1985,8 @@ func (c *DatabaseMigrationService) DescribeEventsRequest(input *DescribeEventsIn
// //
// Lists events for a given source identifier and source type. You can also // Lists events for a given source identifier and source type. You can also
// specify a start and end time. For more information on AWS DMS events, see // specify a start and end time. For more information on AWS DMS events, see
// Working with Events and Notifications (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html). // Working with Events and Notifications (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html)
// in the AWS Database Migration User Guide.
// //
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about // with awserr.Error's Code and Message methods to get detailed information about
@ -3827,8 +3832,9 @@ func (c *DatabaseMigrationService) ModifyReplicationTaskRequest(input *ModifyRep
// You can't modify the task endpoints. The task must be stopped before you // You can't modify the task endpoints. The task must be stopped before you
// can modify it. // can modify it.
// //
// For more information about AWS DMS tasks, see the AWS DMS user guide at // For more information about AWS DMS tasks, see Working with Migration Tasks
// Working with Migration Tasks (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.html) // (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.html) in the
// AWS Database Migration Service User Guide.
// //
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about // with awserr.Error's Code and Message methods to get detailed information about
@ -4170,6 +4176,7 @@ func (c *DatabaseMigrationService) RemoveTagsFromResourceRequest(input *RemoveTa
output = &RemoveTagsFromResourceOutput{} output = &RemoveTagsFromResourceOutput{}
req = c.newRequest(op, input, output) req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return return
} }
@ -4256,8 +4263,9 @@ func (c *DatabaseMigrationService) StartReplicationTaskRequest(input *StartRepli
// //
// Starts the replication task. // Starts the replication task.
// //
// For more information about AWS DMS tasks, see the AWS DMS user guide at // For more information about AWS DMS tasks, see Working with Migration Tasks
// Working with Migration Tasks (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.html) // (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.html) in the
// AWS Database Migration Service User Guide.
// //
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about // with awserr.Error's Code and Message methods to get detailed information about
@ -4878,9 +4886,9 @@ type CreateEndpointInput struct {
// The name of the endpoint database. // The name of the endpoint database.
DatabaseName *string `type:"string"` DatabaseName *string `type:"string"`
// The settings in JSON format for the DMS Transfer type source endpoint. // The settings in JSON format for the DMS transfer type of source endpoint.
// //
// Attributes include: // Possible attributes include the following:
// //
// * serviceAccessRoleArn - The IAM role that has permission to access the // * serviceAccessRoleArn - The IAM role that has permission to access the
// Amazon S3 bucket. // Amazon S3 bucket.
@ -4888,23 +4896,27 @@ type CreateEndpointInput struct {
// * bucketName - The name of the S3 bucket to use. // * bucketName - The name of the S3 bucket to use.
// //
// * compressionType - An optional parameter to use GZIP to compress the // * compressionType - An optional parameter to use GZIP to compress the
// target files. Set to NONE (the default) or do not use to leave the files // target files. To use GZIP, set this value to NONE (the default). To keep
// uncompressed. // the files uncompressed, don't use this value.
// //
// Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string // Shorthand syntax for these attributes is as follows: ServiceAccessRoleArn=string,BucketName=string,CompressionType=string
// //
// JSON syntax: // JSON syntax for these attributes is as follows: { "ServiceAccessRoleArn":
// // "string", "BucketName": "string", "CompressionType": "none"|"gzip" }
// { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType":
// "none"|"gzip" }
DmsTransferSettings *DmsTransferSettings `type:"structure"` DmsTransferSettings *DmsTransferSettings `type:"structure"`
// Settings in JSON format for the target Amazon DynamoDB endpoint. For more // Settings in JSON format for the target Amazon DynamoDB endpoint. For more
// information about the available settings, see the Using Object Mapping to // information about the available settings, see Using Object Mapping to Migrate
// Migrate Data to DynamoDB section at Using an Amazon DynamoDB Database as // Data to DynamoDB (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.DynamoDB.html)
// a Target for AWS Database Migration Service (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.DynamoDB.html). // in the AWS Database Migration Service User Guide.
DynamoDbSettings *DynamoDbSettings `type:"structure"` DynamoDbSettings *DynamoDbSettings `type:"structure"`
// Settings in JSON format for the target Elasticsearch endpoint. For more information
// about the available settings, see Extra Connection Attributes When Using
// Elasticsearch as a Target for AWS DMS (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Elasticsearch.html#CHAP_Target.Elasticsearch.Configuration)
// in the AWS Database Migration User Guide.
ElasticsearchSettings *ElasticsearchSettings `type:"structure"`
// The database endpoint identifier. Identifiers must begin with a letter; must // The database endpoint identifier. Identifiers must begin with a letter; must
// contain only ASCII letters, digits, and hyphens; and must not end with a // contain only ASCII letters, digits, and hyphens; and must not end with a
// hyphen or contain two consecutive hyphens. // hyphen or contain two consecutive hyphens.
@ -4917,9 +4929,9 @@ type CreateEndpointInput struct {
// EndpointType is a required field // EndpointType is a required field
EndpointType *string `type:"string" required:"true" enum:"ReplicationEndpointTypeValue"` EndpointType *string `type:"string" required:"true" enum:"ReplicationEndpointTypeValue"`
// The type of engine for the endpoint. Valid values, depending on the EndPointType, // The type of engine for the endpoint. Valid values, depending on the EndPointType
// include mysql, oracle, postgres, mariadb, aurora, aurora-postgresql, redshift, // value, include mysql, oracle, postgres, mariadb, aurora, aurora-postgresql,
// s3, db2, azuredb, sybase, dynamodb, mongodb, and sqlserver. // redshift, s3, db2, azuredb, sybase, dynamodb, mongodb, and sqlserver.
// //
// EngineName is a required field // EngineName is a required field
EngineName *string `type:"string" required:"true"` EngineName *string `type:"string" required:"true"`
@ -4930,48 +4942,53 @@ type CreateEndpointInput struct {
// Additional attributes associated with the connection. // Additional attributes associated with the connection.
ExtraConnectionAttributes *string `type:"string"` ExtraConnectionAttributes *string `type:"string"`
// The KMS key identifier that will be used to encrypt the connection parameters. // Settings in JSON format for the target Amazon Kinesis Data Streams endpoint.
// If you do not specify a value for the KmsKeyId parameter, then AWS DMS will // For more information about the available settings, see Using Object Mapping
// use your default encryption key. AWS KMS creates the default encryption key // to Migrate Data to a Kinesis Data Stream (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Kinesis.html#CHAP_Target.Kinesis.ObjectMapping
// for your AWS account. Your AWS account has a different default encryption // ) in the AWS Database Migration User Guide.
// key for each AWS region. KinesisSettings *KinesisSettings `type:"structure"`
// The AWS KMS key identifier to use to encrypt the connection parameters. If
// you don't specify a value for the KmsKeyId parameter, then AWS DMS uses your
// default encryption key. AWS KMS creates the default encryption key for your
// AWS account. Your AWS account has a different default encryption key for
// each AWS Region.
KmsKeyId *string `type:"string"` KmsKeyId *string `type:"string"`
// Settings in JSON format for the source MongoDB endpoint. For more information // Settings in JSON format for the source MongoDB endpoint. For more information
// about the available settings, see the Configuration Properties When Using // about the available settings, see the configuration properties section in
// MongoDB as a Source for AWS Database Migration Service section at Using // Using MongoDB as a Target for AWS Database Migration Service (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MongoDB.html)
// MongoDB as a Target for AWS Database Migration Service (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MongoDB.html). // in the AWS Database Migration Service User Guide.
MongoDbSettings *MongoDbSettings `type:"structure"` MongoDbSettings *MongoDbSettings `type:"structure"`
// The password to be used to login to the endpoint database. // The password to be used to log in to the endpoint database.
Password *string `type:"string"` Password *string `type:"string" sensitive:"true"`
// The port used by the endpoint database. // The port used by the endpoint database.
Port *int64 `type:"integer"` Port *int64 `type:"integer"`
// Settings in JSON format for the target Amazon S3 endpoint. For more information // Settings in JSON format for the target Amazon S3 endpoint. For more information
// about the available settings, see the Extra Connection Attributes section // about the available settings, see Extra Connection Attributes When Using
// at Using Amazon S3 as a Target for AWS Database Migration Service (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html). // Amazon S3 as a Target for AWS DMS (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html#CHAP_Target.S3.Configuring)
// in the AWS Database Migration Service User Guide.
S3Settings *S3Settings `type:"structure"` S3Settings *S3Settings `type:"structure"`
// The name of the server where the endpoint database resides. // The name of the server where the endpoint database resides.
ServerName *string `type:"string"` ServerName *string `type:"string"`
// The Amazon Resource Name (ARN) for the service access role you want to use // The Amazon Resource Name (ARN) for the service access role that you want
// to create the endpoint. // to use to create the endpoint.
ServiceAccessRoleArn *string `type:"string"` ServiceAccessRoleArn *string `type:"string"`
// The SSL mode to use for the SSL connection. // The Secure Sockets Layer (SSL) mode to use for the SSL connection. The SSL
// // mode can be one of four values: none, require, verify-ca, verify-full. The
// SSL mode can be one of four values: none, require, verify-ca, verify-full. // default value is none.
//
// The default value is none.
SslMode *string `type:"string" enum:"DmsSslModeValue"` SslMode *string `type:"string" enum:"DmsSslModeValue"`
// Tags to be added to the endpoint. // Tags to be added to the endpoint.
Tags []*Tag `type:"list"` Tags []*Tag `type:"list"`
// The user name to be used to login to the endpoint database. // The user name to be used to log in to the endpoint database.
Username *string `type:"string"` Username *string `type:"string"`
} }
@ -5002,6 +5019,11 @@ func (s *CreateEndpointInput) Validate() error {
invalidParams.AddNested("DynamoDbSettings", err.(request.ErrInvalidParams)) invalidParams.AddNested("DynamoDbSettings", err.(request.ErrInvalidParams))
} }
} }
if s.ElasticsearchSettings != nil {
if err := s.ElasticsearchSettings.Validate(); err != nil {
invalidParams.AddNested("ElasticsearchSettings", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 { if invalidParams.Len() > 0 {
return invalidParams return invalidParams
@ -5033,6 +5055,12 @@ func (s *CreateEndpointInput) SetDynamoDbSettings(v *DynamoDbSettings) *CreateEn
return s return s
} }
// SetElasticsearchSettings sets the ElasticsearchSettings field's value.
func (s *CreateEndpointInput) SetElasticsearchSettings(v *ElasticsearchSettings) *CreateEndpointInput {
s.ElasticsearchSettings = v
return s
}
// SetEndpointIdentifier sets the EndpointIdentifier field's value. // SetEndpointIdentifier sets the EndpointIdentifier field's value.
func (s *CreateEndpointInput) SetEndpointIdentifier(v string) *CreateEndpointInput { func (s *CreateEndpointInput) SetEndpointIdentifier(v string) *CreateEndpointInput {
s.EndpointIdentifier = &v s.EndpointIdentifier = &v
@ -5063,6 +5091,12 @@ func (s *CreateEndpointInput) SetExtraConnectionAttributes(v string) *CreateEndp
return s return s
} }
// SetKinesisSettings sets the KinesisSettings field's value.
func (s *CreateEndpointInput) SetKinesisSettings(v *KinesisSettings) *CreateEndpointInput {
s.KinesisSettings = v
return s
}
// SetKmsKeyId sets the KmsKeyId field's value. // SetKmsKeyId sets the KmsKeyId field's value.
func (s *CreateEndpointInput) SetKmsKeyId(v string) *CreateEndpointInput { func (s *CreateEndpointInput) SetKmsKeyId(v string) *CreateEndpointInput {
s.KmsKeyId = &v s.KmsKeyId = &v
@ -5155,7 +5189,7 @@ type CreateEventSubscriptionInput struct {
// A list of event categories for a source type that you want to subscribe to. // A list of event categories for a source type that you want to subscribe to.
// You can see a list of the categories for a given source type by calling the // You can see a list of the categories for a given source type by calling the
// DescribeEventCategories action or in the topic Working with Events and Notifications // DescribeEventCategories action or in the topic Working with Events and Notifications
// (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html) in the // (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Events.html) in the
// AWS Database Migration Service User Guide. // AWS Database Migration Service User Guide.
EventCategories []*string `type:"list"` EventCategories []*string `type:"list"`
@ -5303,14 +5337,17 @@ type CreateReplicationInstanceInput struct {
// Example: us-east-1d // Example: us-east-1d
AvailabilityZone *string `type:"string"` AvailabilityZone *string `type:"string"`
// A list of DNS name servers supported for the replication instance.
DnsNameServers *string `type:"string"`
// The engine version number of the replication instance. // The engine version number of the replication instance.
EngineVersion *string `type:"string"` EngineVersion *string `type:"string"`
// The KMS key identifier that will be used to encrypt the content on the replication // The AWS KMS key identifier that is used to encrypt the content on the replication
// instance. If you do not specify a value for the KmsKeyId parameter, then // instance. If you don't specify a value for the KmsKeyId parameter, then AWS
// AWS DMS will use your default encryption key. AWS KMS creates the default // DMS uses your default encryption key. AWS KMS creates the default encryption
// encryption key for your AWS account. Your AWS account has a different default // key for your AWS account. Your AWS account has a different default encryption
// encryption key for each AWS region. // key for each AWS Region.
KmsKeyId *string `type:"string"` KmsKeyId *string `type:"string"`
// Specifies if the replication instance is a Multi-AZ deployment. You cannot // Specifies if the replication instance is a Multi-AZ deployment. You cannot
@ -5416,6 +5453,12 @@ func (s *CreateReplicationInstanceInput) SetAvailabilityZone(v string) *CreateRe
return s return s
} }
// SetDnsNameServers sets the DnsNameServers field's value.
func (s *CreateReplicationInstanceInput) SetDnsNameServers(v string) *CreateReplicationInstanceInput {
s.DnsNameServers = &v
return s
}
// SetEngineVersion sets the EngineVersion field's value. // SetEngineVersion sets the EngineVersion field's value.
func (s *CreateReplicationInstanceInput) SetEngineVersion(v string) *CreateReplicationInstanceInput { func (s *CreateReplicationInstanceInput) SetEngineVersion(v string) *CreateReplicationInstanceInput {
s.EngineVersion = &v s.EngineVersion = &v
@ -5660,7 +5703,8 @@ type CreateReplicationTaskInput struct {
// Settings for the task, such as target metadata settings. For a complete list // Settings for the task, such as target metadata settings. For a complete list
// of task settings, see Task Settings for AWS Database Migration Service Tasks // of task settings, see Task Settings for AWS Database Migration Service Tasks
// (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html). // (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html)
// in the AWS Database Migration User Guide.
ReplicationTaskSettings *string `type:"string"` ReplicationTaskSettings *string `type:"string"`
// The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
@ -7924,6 +7968,78 @@ func (s *DynamoDbSettings) SetServiceAccessRoleArn(v string) *DynamoDbSettings {
return s return s
} }
type ElasticsearchSettings struct {
_ struct{} `type:"structure"`
// The endpoint for the ElasticSearch cluster.
//
// EndpointUri is a required field
EndpointUri *string `type:"string" required:"true"`
// The maximum number of seconds that DMS retries failed API requests to the
// Elasticsearch cluster.
ErrorRetryDuration *int64 `type:"integer"`
// The maximum percentage of records that can fail to be written before a full
// load operation stops.
FullLoadErrorPercentage *int64 `type:"integer"`
// The Amazon Resource Name (ARN) used by service to access the IAM role.
//
// ServiceAccessRoleArn is a required field
ServiceAccessRoleArn *string `type:"string" required:"true"`
}
// String returns the string representation
func (s ElasticsearchSettings) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ElasticsearchSettings) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ElasticsearchSettings) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ElasticsearchSettings"}
if s.EndpointUri == nil {
invalidParams.Add(request.NewErrParamRequired("EndpointUri"))
}
if s.ServiceAccessRoleArn == nil {
invalidParams.Add(request.NewErrParamRequired("ServiceAccessRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetEndpointUri sets the EndpointUri field's value.
func (s *ElasticsearchSettings) SetEndpointUri(v string) *ElasticsearchSettings {
s.EndpointUri = &v
return s
}
// SetErrorRetryDuration sets the ErrorRetryDuration field's value.
func (s *ElasticsearchSettings) SetErrorRetryDuration(v int64) *ElasticsearchSettings {
s.ErrorRetryDuration = &v
return s
}
// SetFullLoadErrorPercentage sets the FullLoadErrorPercentage field's value.
func (s *ElasticsearchSettings) SetFullLoadErrorPercentage(v int64) *ElasticsearchSettings {
s.FullLoadErrorPercentage = &v
return s
}
// SetServiceAccessRoleArn sets the ServiceAccessRoleArn field's value.
func (s *ElasticsearchSettings) SetServiceAccessRoleArn(v string) *ElasticsearchSettings {
s.ServiceAccessRoleArn = &v
return s
}
type Endpoint struct { type Endpoint struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
@ -7933,9 +8049,9 @@ type Endpoint struct {
// The name of the database at the endpoint. // The name of the database at the endpoint.
DatabaseName *string `type:"string"` DatabaseName *string `type:"string"`
// The settings in JSON format for the DMS Transfer type source endpoint. // The settings in JSON format for the DMS transfer type of source endpoint.
// //
// Attributes include: // Possible attributes include the following:
// //
// * serviceAccessRoleArn - The IAM role that has permission to access the // * serviceAccessRoleArn - The IAM role that has permission to access the
// Amazon S3 bucket. // Amazon S3 bucket.
@ -7943,21 +8059,23 @@ type Endpoint struct {
// * bucketName - The name of the S3 bucket to use. // * bucketName - The name of the S3 bucket to use.
// //
// * compressionType - An optional parameter to use GZIP to compress the // * compressionType - An optional parameter to use GZIP to compress the
// target files. Set to NONE (the default) or do not use to leave the files // target files. To use GZIP, set this value to NONE (the default). To keep
// uncompressed. // the files uncompressed, don't use this value.
// //
// Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string // Shorthand syntax for these attributes is as follows: ServiceAccessRoleArn=string,BucketName=string,CompressionType=string
// //
// JSON syntax: // JSON syntax for these attributes is as follows: { "ServiceAccessRoleArn":
// // "string", "BucketName": "string", "CompressionType": "none"|"gzip" }
// { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType":
// "none"|"gzip" }
DmsTransferSettings *DmsTransferSettings `type:"structure"` DmsTransferSettings *DmsTransferSettings `type:"structure"`
// The settings for the target DynamoDB database. For more information, see // The settings for the target DynamoDB database. For more information, see
// the DynamoDBSettings structure. // the DynamoDBSettings structure.
DynamoDbSettings *DynamoDbSettings `type:"structure"` DynamoDbSettings *DynamoDbSettings `type:"structure"`
// The settings for the Elasticsearch source endpoint. For more information,
// see the ElasticsearchSettings structure.
ElasticsearchSettings *ElasticsearchSettings `type:"structure"`
// The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
EndpointArn *string `type:"string"` EndpointArn *string `type:"string"`
@ -7989,11 +8107,15 @@ type Endpoint struct {
// Additional connection attributes used to connect to the endpoint. // Additional connection attributes used to connect to the endpoint.
ExtraConnectionAttributes *string `type:"string"` ExtraConnectionAttributes *string `type:"string"`
// The KMS key identifier that will be used to encrypt the connection parameters. // The settings for the Amazon Kinesis source endpoint. For more information,
// If you do not specify a value for the KmsKeyId parameter, then AWS DMS will // see the KinesisSettings structure.
// use your default encryption key. AWS KMS creates the default encryption key KinesisSettings *KinesisSettings `type:"structure"`
// for your AWS account. Your AWS account has a different default encryption
// key for each AWS region. // The AWS KMS key identifier that is used to encrypt the content on the replication
// instance. If you don't specify a value for the KmsKeyId parameter, then AWS
// DMS uses your default encryption key. AWS KMS creates the default encryption
// key for your AWS account. Your AWS account has a different default encryption
// key for each AWS Region.
KmsKeyId *string `type:"string"` KmsKeyId *string `type:"string"`
// The settings for the MongoDB source endpoint. For more information, see the // The settings for the MongoDB source endpoint. For more information, see the
@ -8061,6 +8183,12 @@ func (s *Endpoint) SetDynamoDbSettings(v *DynamoDbSettings) *Endpoint {
return s return s
} }
// SetElasticsearchSettings sets the ElasticsearchSettings field's value.
func (s *Endpoint) SetElasticsearchSettings(v *ElasticsearchSettings) *Endpoint {
s.ElasticsearchSettings = v
return s
}
// SetEndpointArn sets the EndpointArn field's value. // SetEndpointArn sets the EndpointArn field's value.
func (s *Endpoint) SetEndpointArn(v string) *Endpoint { func (s *Endpoint) SetEndpointArn(v string) *Endpoint {
s.EndpointArn = &v s.EndpointArn = &v
@ -8109,6 +8237,12 @@ func (s *Endpoint) SetExtraConnectionAttributes(v string) *Endpoint {
return s return s
} }
// SetKinesisSettings sets the KinesisSettings field's value.
func (s *Endpoint) SetKinesisSettings(v *KinesisSettings) *Endpoint {
s.KinesisSettings = v
return s
}
// SetKmsKeyId sets the KmsKeyId field's value. // SetKmsKeyId sets the KmsKeyId field's value.
func (s *Endpoint) SetKmsKeyId(v string) *Endpoint { func (s *Endpoint) SetKmsKeyId(v string) *Endpoint {
s.KmsKeyId = &v s.KmsKeyId = &v
@ -8513,6 +8647,49 @@ func (s *ImportCertificateOutput) SetCertificate(v *Certificate) *ImportCertific
return s return s
} }
type KinesisSettings struct {
_ struct{} `type:"structure"`
// The output format for the records created on the endpoint. The message format
// is JSON.
MessageFormat *string `type:"string" enum:"MessageFormatValue"`
// The Amazon Resource Name (ARN) for the IAM role that DMS uses to write to
// the Amazon Kinesis data stream.
ServiceAccessRoleArn *string `type:"string"`
// The Amazon Resource Name (ARN) for the Amazon Kinesis Data Streams endpoint.
StreamArn *string `type:"string"`
}
// String returns the string representation
func (s KinesisSettings) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s KinesisSettings) GoString() string {
return s.String()
}
// SetMessageFormat sets the MessageFormat field's value.
func (s *KinesisSettings) SetMessageFormat(v string) *KinesisSettings {
s.MessageFormat = &v
return s
}
// SetServiceAccessRoleArn sets the ServiceAccessRoleArn field's value.
func (s *KinesisSettings) SetServiceAccessRoleArn(v string) *KinesisSettings {
s.ServiceAccessRoleArn = &v
return s
}
// SetStreamArn sets the StreamArn field's value.
func (s *KinesisSettings) SetStreamArn(v string) *KinesisSettings {
s.StreamArn = &v
return s
}
type ListTagsForResourceInput struct { type ListTagsForResourceInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
@ -8584,9 +8761,9 @@ type ModifyEndpointInput struct {
// The name of the endpoint database. // The name of the endpoint database.
DatabaseName *string `type:"string"` DatabaseName *string `type:"string"`
// The settings in JSON format for the DMS Transfer type source endpoint. // The settings in JSON format for the DMS transfer type of source endpoint.
// //
// Attributes include: // Attributes include the following:
// //
// * serviceAccessRoleArn - The IAM role that has permission to access the // * serviceAccessRoleArn - The IAM role that has permission to access the
// Amazon S3 bucket. // Amazon S3 bucket.
@ -8606,11 +8783,17 @@ type ModifyEndpointInput struct {
DmsTransferSettings *DmsTransferSettings `type:"structure"` DmsTransferSettings *DmsTransferSettings `type:"structure"`
// Settings in JSON format for the target Amazon DynamoDB endpoint. For more // Settings in JSON format for the target Amazon DynamoDB endpoint. For more
// information about the available settings, see the Using Object Mapping to // information about the available settings, see Using Object Mapping to Migrate
// Migrate Data to DynamoDB section at Using an Amazon DynamoDB Database as // Data to DynamoDB (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.DynamoDB.html)
// a Target for AWS Database Migration Service (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.DynamoDB.html). // in the AWS Database Migration Service User Guide.
DynamoDbSettings *DynamoDbSettings `type:"structure"` DynamoDbSettings *DynamoDbSettings `type:"structure"`
// Settings in JSON format for the target Elasticsearch endpoint. For more information
// about the available settings, see Extra Connection Attributes When Using
// Elasticsearch as a Target for AWS DMS (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Elasticsearch.html#CHAP_Target.Elasticsearch.Configuration)
// in the AWS Database Migration User Guide.
ElasticsearchSettings *ElasticsearchSettings `type:"structure"`
// The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
// //
// EndpointArn is a required field // EndpointArn is a required field
@ -8636,21 +8819,28 @@ type ModifyEndpointInput struct {
// pass the empty string ("") as an argument. // pass the empty string ("") as an argument.
ExtraConnectionAttributes *string `type:"string"` ExtraConnectionAttributes *string `type:"string"`
// Settings in JSON format for the target Amazon Kinesis Data Streams endpoint.
// For more information about the available settings, see Using Object Mapping
// to Migrate Data to a Kinesis Data Stream (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Kinesis.html#CHAP_Target.Kinesis.ObjectMapping
// ) in the AWS Database Migration User Guide.
KinesisSettings *KinesisSettings `type:"structure"`
// Settings in JSON format for the source MongoDB endpoint. For more information // Settings in JSON format for the source MongoDB endpoint. For more information
// about the available settings, see the Configuration Properties When Using // about the available settings, see the configuration properties section in
// MongoDB as a Source for AWS Database Migration Service section at Using // Using MongoDB as a Target for AWS Database Migration Service (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MongoDB.html)
// Amazon S3 as a Target for AWS Database Migration Service (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MongoDB.html). // in the AWS Database Migration Service User Guide.
MongoDbSettings *MongoDbSettings `type:"structure"` MongoDbSettings *MongoDbSettings `type:"structure"`
// The password to be used to login to the endpoint database. // The password to be used to login to the endpoint database.
Password *string `type:"string"` Password *string `type:"string" sensitive:"true"`
// The port used by the endpoint database. // The port used by the endpoint database.
Port *int64 `type:"integer"` Port *int64 `type:"integer"`
// Settings in JSON format for the target S3 endpoint. For more information // Settings in JSON format for the target Amazon S3 endpoint. For more information
// about the available settings, see the Extra Connection Attributes section // about the available settings, see Extra Connection Attributes When Using
// at Using Amazon S3 as a Target for AWS Database Migration Service (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html). // Amazon S3 as a Target for AWS DMS (http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html#CHAP_Target.S3.Configuring)
// in the AWS Database Migration Service User Guide.
S3Settings *S3Settings `type:"structure"` S3Settings *S3Settings `type:"structure"`
// The name of the server where the endpoint database resides. // The name of the server where the endpoint database resides.
@ -8692,6 +8882,11 @@ func (s *ModifyEndpointInput) Validate() error {
invalidParams.AddNested("DynamoDbSettings", err.(request.ErrInvalidParams)) invalidParams.AddNested("DynamoDbSettings", err.(request.ErrInvalidParams))
} }
} }
if s.ElasticsearchSettings != nil {
if err := s.ElasticsearchSettings.Validate(); err != nil {
invalidParams.AddNested("ElasticsearchSettings", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 { if invalidParams.Len() > 0 {
return invalidParams return invalidParams
@ -8723,6 +8918,12 @@ func (s *ModifyEndpointInput) SetDynamoDbSettings(v *DynamoDbSettings) *ModifyEn
return s return s
} }
// SetElasticsearchSettings sets the ElasticsearchSettings field's value.
func (s *ModifyEndpointInput) SetElasticsearchSettings(v *ElasticsearchSettings) *ModifyEndpointInput {
s.ElasticsearchSettings = v
return s
}
// SetEndpointArn sets the EndpointArn field's value. // SetEndpointArn sets the EndpointArn field's value.
func (s *ModifyEndpointInput) SetEndpointArn(v string) *ModifyEndpointInput { func (s *ModifyEndpointInput) SetEndpointArn(v string) *ModifyEndpointInput {
s.EndpointArn = &v s.EndpointArn = &v
@ -8759,6 +8960,12 @@ func (s *ModifyEndpointInput) SetExtraConnectionAttributes(v string) *ModifyEndp
return s return s
} }
// SetKinesisSettings sets the KinesisSettings field's value.
func (s *ModifyEndpointInput) SetKinesisSettings(v *KinesisSettings) *ModifyEndpointInput {
s.KinesisSettings = v
return s
}
// SetMongoDbSettings sets the MongoDbSettings field's value. // SetMongoDbSettings sets the MongoDbSettings field's value.
func (s *ModifyEndpointInput) SetMongoDbSettings(v *MongoDbSettings) *ModifyEndpointInput { func (s *ModifyEndpointInput) SetMongoDbSettings(v *MongoDbSettings) *ModifyEndpointInput {
s.MongoDbSettings = v s.MongoDbSettings = v
@ -9399,11 +9606,11 @@ type MongoDbSettings struct {
// Default value is false. // Default value is false.
ExtractDocId *string `type:"string"` ExtractDocId *string `type:"string"`
// The KMS key identifier that will be used to encrypt the connection parameters. // The AWS KMS key identifier that is used to encrypt the content on the replication
// If you do not specify a value for the KmsKeyId parameter, then AWS DMS will // instance. If you don't specify a value for the KmsKeyId parameter, then AWS
// use your default encryption key. AWS KMS creates the default encryption key // DMS uses your default encryption key. AWS KMS creates the default encryption
// for your AWS account. Your AWS account has a different default encryption // key for your AWS account. Your AWS account has a different default encryption
// key for each AWS region. // key for each AWS Region.
KmsKeyId *string `type:"string"` KmsKeyId *string `type:"string"`
// Specifies either document or table mode. // Specifies either document or table mode.
@ -9415,7 +9622,7 @@ type MongoDbSettings struct {
NestingLevel *string `type:"string" enum:"NestingLevelValue"` NestingLevel *string `type:"string" enum:"NestingLevelValue"`
// The password for the user account you use to access the MongoDB source endpoint. // The password for the user account you use to access the MongoDB source endpoint.
Password *string `type:"string"` Password *string `type:"string" sensitive:"true"`
// The port value for the MongoDB source endpoint. // The port value for the MongoDB source endpoint.
Port *int64 `type:"integer"` Port *int64 `type:"integer"`
@ -9969,6 +10176,9 @@ type ReplicationInstance struct {
// The Availability Zone for the instance. // The Availability Zone for the instance.
AvailabilityZone *string `type:"string"` AvailabilityZone *string `type:"string"`
// The DNS name servers for the replication instance.
DnsNameServers *string `type:"string"`
// The engine version number of the replication instance. // The engine version number of the replication instance.
EngineVersion *string `type:"string"` EngineVersion *string `type:"string"`
@ -9979,11 +10189,11 @@ type ReplicationInstance struct {
// The time the replication instance was created. // The time the replication instance was created.
InstanceCreateTime *time.Time `type:"timestamp"` InstanceCreateTime *time.Time `type:"timestamp"`
// The KMS key identifier that is used to encrypt the content on the replication // The AWS KMS key identifier that is used to encrypt the content on the replication
// instance. If you do not specify a value for the KmsKeyId parameter, then // instance. If you don't specify a value for the KmsKeyId parameter, then AWS
// AWS DMS will use your default encryption key. AWS KMS creates the default // DMS uses your default encryption key. AWS KMS creates the default encryption
// encryption key for your AWS account. Your AWS account has a different default // key for your AWS account. Your AWS account has a different default encryption
// encryption key for each AWS region. // key for each AWS Region.
KmsKeyId *string `type:"string"` KmsKeyId *string `type:"string"`
// Specifies if the replication instance is a Multi-AZ deployment. You cannot // Specifies if the replication instance is a Multi-AZ deployment. You cannot
@ -10081,6 +10291,12 @@ func (s *ReplicationInstance) SetAvailabilityZone(v string) *ReplicationInstance
return s return s
} }
// SetDnsNameServers sets the DnsNameServers field's value.
func (s *ReplicationInstance) SetDnsNameServers(v string) *ReplicationInstance {
s.DnsNameServers = &v
return s
}
// SetEngineVersion sets the EngineVersion field's value. // SetEngineVersion sets the EngineVersion field's value.
func (s *ReplicationInstance) SetEngineVersion(v string) *ReplicationInstance { func (s *ReplicationInstance) SetEngineVersion(v string) *ReplicationInstance {
s.EngineVersion = &v s.EngineVersion = &v
@ -11519,6 +11735,11 @@ const (
DmsSslModeValueVerifyFull = "verify-full" DmsSslModeValueVerifyFull = "verify-full"
) )
const (
// MessageFormatValueJson is a MessageFormatValue enum value
MessageFormatValueJson = "json"
)
const ( const (
// MigrationTypeValueFullLoad is a MigrationTypeValue enum value // MigrationTypeValueFullLoad is a MigrationTypeValue enum value
MigrationTypeValueFullLoad = "full-load" MigrationTypeValueFullLoad = "full-load"

View File

@ -11,8 +11,9 @@
// between different database platforms, such as Oracle to MySQL or SQL Server // between different database platforms, such as Oracle to MySQL or SQL Server
// to PostgreSQL. // to PostgreSQL.
// //
// For more information about AWS DMS, see the AWS DMS user guide at What Is // For more information about AWS DMS, see What Is AWS Database Migration Service?
// AWS Database Migration Service? (http://docs.aws.amazon.com/dms/latest/userguide/Welcome.html) // (http://docs.aws.amazon.com/dms/latest/userguide/Welcome.html) in the AWS
// Database Migration User Guide.
// //
// See https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01 for more information on this service. // See https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01 for more information on this service.
// //

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