change github.com/aws/aws-sdk-go to be the same revision in kubernetes

This commit is contained in:
Jingfang Liu
2018-10-16 09:34:22 -07:00
parent e0958159f3
commit c6a78cee92
462 changed files with 20605 additions and 85780 deletions

View File

@@ -95,42 +95,6 @@ func ExampleSecretsManager_CreateSecret_shared00() {
fmt.Println(secretsmanager.ErrCodeMalformedPolicyDocumentException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, aerr.Error())
case secretsmanager.ErrCodePreconditionNotMetException:
fmt.Println(secretsmanager.ErrCodePreconditionNotMetException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To delete the resource-based policy attached to a secret
//
// The following example shows how to delete the resource-based policy that is attached
// to a secret.
func ExampleSecretsManager_DeleteResourcePolicy_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.DeleteResourcePolicyInput{
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.DeleteResourcePolicy(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
@@ -252,40 +216,6 @@ func ExampleSecretsManager_GetRandomPassword_shared00() {
fmt.Println(result)
}
// To retrieve the resource-based policy attached to a secret
//
// The following example shows how to retrieve the resource-based policy that is attached
// to a secret.
func ExampleSecretsManager_GetResourcePolicy_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.GetResourcePolicyInput{
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.GetResourcePolicy(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To retrieve the encrypted secret value of a secret
//
// The following example shows how to retrieve the secret string value from the version
@@ -393,44 +323,6 @@ func ExampleSecretsManager_ListSecrets_shared00() {
fmt.Println(result)
}
// To add a resource-based policy to a secret
//
// The following example shows how to add a resource-based policy to a secret.
func ExampleSecretsManager_PutResourcePolicy_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.PutResourcePolicyInput{
ResourcePolicy: aws.String("{\n\"Version\":\"2012-10-17\",\n\"Statement\":[{\n\"Effect\":\"Allow\",\n\"Principal\":{\n\"AWS\":\"arn:aws:iam::123456789012:root\"\n},\n\"Action\":\"secretsmanager:GetSecretValue\",\n\"Resource\":\"*\"\n}]\n}"),
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.PutResourcePolicy(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeMalformedPolicyDocumentException:
fmt.Println(secretsmanager.ErrCodeMalformedPolicyDocumentException, aerr.Error())
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To store a secret value in a new version of a secret
//
// The following example shows how to create a new version of the secret. Alternatively,
@@ -617,8 +509,6 @@ func ExampleSecretsManager_TagResource_shared00() {
switch aerr.Code() {
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
@@ -658,8 +548,6 @@ func ExampleSecretsManager_UntagResource_shared00() {
switch aerr.Code() {
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
@@ -709,8 +597,6 @@ func ExampleSecretsManager_UpdateSecret_shared00() {
fmt.Println(secretsmanager.ErrCodeMalformedPolicyDocumentException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, aerr.Error())
case secretsmanager.ErrCodePreconditionNotMetException:
fmt.Println(secretsmanager.ErrCodePreconditionNotMetException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
@@ -756,8 +642,6 @@ func ExampleSecretsManager_UpdateSecret_shared01() {
fmt.Println(secretsmanager.ErrCodeMalformedPolicyDocumentException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, aerr.Error())
case secretsmanager.ErrCodePreconditionNotMetException:
fmt.Println(secretsmanager.ErrCodePreconditionNotMetException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
@@ -803,8 +687,6 @@ func ExampleSecretsManager_UpdateSecret_shared02() {
fmt.Println(secretsmanager.ErrCodeMalformedPolicyDocumentException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, aerr.Error())
case secretsmanager.ErrCodePreconditionNotMetException:
fmt.Println(secretsmanager.ErrCodePreconditionNotMetException, aerr.Error())
default:
fmt.Println(aerr.Error())
}