Update Go AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2019-07-13 00:03:55 +03:00
committed by Andrey Smirnov
parent d08be990ef
commit 94a72b23ff
2183 changed files with 885887 additions and 228114 deletions
File diff suppressed because it is too large Load Diff
+22 -43
View File
@@ -6,14 +6,13 @@
// AWS Secrets Manager is a web service that enables you to store, manage, and
// retrieve, secrets.
//
// This guide provides descriptions of the AWS Secrets Manager API. For more
// information about using this service, see the AWS Secrets Manager User Guide
// (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/secretsmanager/latest/userguide/introduction.html).
// This guide provides descriptions of the Secrets Manager API. For more information
// about using this service, see the AWS Secrets Manager User Guide (https://docs.aws.amazon.com/secretsmanager/latest/userguide/introduction.html).
//
// API Version
//
// This version of the AWS Secrets Manager API Reference documents the AWS Secrets
// Manager API version 2017-10-17.
// This version of the Secrets Manager API Reference documents the Secrets Manager
// API version 2017-10-17.
//
// As an alternative to using the API directly, you can use one of the AWS SDKs,
// which consist of libraries and sample code for various programming languages
@@ -25,36 +24,15 @@
// Web Services (http://aws.amazon.com/tools/).
//
// We recommend that you use the AWS SDKs to make programmatic API calls to
// AWS Secrets Manager. However, you also can use the AWS Secrets Manager HTTP
// Query API to make direct calls to the AWS Secrets Manager web service. To
// learn more about the AWS Secrets Manager HTTP Query API, see Making Query
// Requests (http://docs.aws.amazon.com/secretsmanager/latest/userguide/orgs_query-requests.html)
// Secrets Manager. However, you also can use the Secrets Manager HTTP Query
// API to make direct calls to the Secrets Manager web service. To learn more
// about the Secrets Manager HTTP Query API, see Making Query Requests (https://docs.aws.amazon.com/secretsmanager/latest/userguide/query-requests.html)
// in the AWS Secrets Manager User Guide.
//
// AWS Secrets Manager supports GET and POST requests for all actions. That
// is, the API doesn't require you to use GET for some actions and POST for
// others. However, GET requests are subject to the limitation size of a URL.
// Therefore, for operations that require larger sizes, use a POST request.
//
// Signing Requests
//
// When you send HTTP requests to AWS, you must sign the requests so that AWS
// can identify who sent them. You sign requests with your AWS access key, which
// consists of an access key ID and a secret access key. We strongly recommend
// that you don't create an access key for your root account. Anyone who has
// the access key for your root account has unrestricted access to all the resources
// in your account. Instead, create an access key for an IAM user account that
// has the permissions required for the task at hand. As another option, use
// AWS Security Token Service to generate temporary security credentials, and
// use those credentials to sign requests.
//
// To sign requests, you must use Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
// If you have an existing application that uses Signature Version 2, you must
// update it to use Signature Version 4.
//
// When you use the AWS Command Line Interface (AWS CLI) or one of the AWS SDKs
// to make requests to AWS, these tools automatically sign the requests for
// you with the access key that you specify when you configure the tools.
// Secrets Manager supports GET and POST requests for all actions. That is,
// the API doesn't require you to use GET for some actions and POST for others.
// However, GET requests are subject to the limitation size of a URL. Therefore,
// for operations that require larger sizes, use a POST request.
//
// Support and Feedback for AWS Secrets Manager
//
@@ -65,11 +43,12 @@
//
// How examples are presented
//
// The JSON that AWS Secrets Manager returns as a response to your requests
// is a single long string without line breaks or white space formatting. Both
// line breaks and white space are included in the examples in this guide to
// improve readability. When example input parameters would also result in long
// strings that extend beyond the screen, we insert line breaks to enhance readability.
// The JSON that AWS Secrets Manager expects as your request parameters and
// that the service returns as a response to HTTP query requests are single,
// long strings without line breaks or white space formatting. The JSON shown
// in the examples is formatted with both line breaks and white space to improve
// readability. When example input parameters would also result in long strings
// that extend beyond the screen, we insert line breaks to enhance readability.
// You should always submit the input as a single JSON text string.
//
// Logging API Requests
@@ -77,13 +56,13 @@
// AWS Secrets Manager supports AWS CloudTrail, a service that records AWS API
// calls for your AWS account and delivers log files to an Amazon S3 bucket.
// By using information that's collected by AWS CloudTrail, you can determine
// which requests were successfully made to AWS Secrets Manager, who made the
// request, when it was made, and so on. For more about AWS Secrets Manager
// and its support for AWS CloudTrail, see Logging AWS Secrets Manager Events
// with AWS CloudTrail (http://docs.aws.amazon.com/secretsmanager/latest/userguide/orgs_cloudtrail-integration.html)
// which requests were successfully made to Secrets Manager, who made the request,
// when it was made, and so on. For more about AWS Secrets Manager and its support
// for AWS CloudTrail, see Logging AWS Secrets Manager Events with AWS CloudTrail
// (http://docs.aws.amazon.com/secretsmanager/latest/userguide/monitoring.html#monitoring_cloudtrail)
// in the AWS Secrets Manager User Guide. To learn more about CloudTrail, including
// how to turn it on and find your log files, see the AWS CloudTrail User Guide
// (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
// (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
//
// See https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17 for more information on this service.
//
+20 -7
View File
@@ -7,14 +7,14 @@ const (
// ErrCodeDecryptionFailure for service response error code
// "DecryptionFailure".
//
// AWS Secrets Manager can't decrypt the protected secret text using the provided
// Secrets Manager can't decrypt the protected secret text using the provided
// KMS key.
ErrCodeDecryptionFailure = "DecryptionFailure"
// ErrCodeEncryptionFailure for service response error code
// "EncryptionFailure".
//
// AWS Secrets Manager can't encrypt the protected secret text using the provided
// Secrets Manager can't encrypt the protected secret text using the provided
// KMS key. Check that the customer master key (CMK) is available, enabled,
// and not in an invalid state. For more information, see How Key State Affects
// Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html).
@@ -42,16 +42,23 @@ const (
// "InvalidRequestException".
//
// You provided a parameter value that is not valid for the current state of
// the resource. For example, if you try to enable rotation on a secret, you
// must already have a Lambda function ARN configured or included as a parameter
// in this call.
// the resource.
//
// Possible causes:
//
// * You tried to perform the operation on a secret that's currently marked
// deleted.
//
// * You tried to enable rotation on a secret that doesn't already have a
// Lambda function ARN configured and you didn't include such an ARN as a
// parameter in this call.
ErrCodeInvalidRequestException = "InvalidRequestException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// The request failed because it would exceed one of the AWS Secrets Manager
// internal limits.
// The request failed because it would exceed one of the Secrets Manager internal
// limits.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeMalformedPolicyDocumentException for service response error code
@@ -60,6 +67,12 @@ const (
// The policy document that you provided isn't valid.
ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocumentException"
// ErrCodePreconditionNotMetException for service response error code
// "PreconditionNotMetException".
//
// The request failed because you did not complete all the prerequisite steps.
ErrCodePreconditionNotMetException = "PreconditionNotMetException"
// ErrCodeResourceExistsException for service response error code
// "ResourceExistsException".
//
@@ -0,0 +1,945 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package secretsmanager_test
import (
"fmt"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/secretsmanager"
)
var _ time.Duration
var _ strings.Reader
var _ aws.Config
func parseTime(layout, value string) *time.Time {
t, err := time.Parse(layout, value)
if err != nil {
panic(err)
}
return &t
}
// To cancel scheduled rotation for a secret
//
// The following example shows how to cancel rotation for a secret. The operation sets
// the RotationEnabled field to false and cancels all scheduled rotations. To resume
// scheduled rotations, you must re-enable rotation by calling the rotate-secret operation.
func ExampleSecretsManager_CancelRotateSecret_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.CancelRotateSecretInput{
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.CancelRotateSecret(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.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 create a basic secret
//
// The following example shows how to create a secret. The credentials stored in the
// encrypted secret value are retrieved from a file on disk named mycreds.json.
func ExampleSecretsManager_CreateSecret_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.CreateSecretInput{
ClientRequestToken: aws.String("EXAMPLE1-90ab-cdef-fedc-ba987SECRET1"),
Description: aws.String("My test database secret created with the CLI"),
Name: aws.String("MyTestDatabaseSecret"),
SecretString: aws.String("{\"username\":\"david\",\"password\":\"BnQw!XDWgaEeT9XGTT29\"}"),
}
result, err := svc.CreateSecret(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeLimitExceededException:
fmt.Println(secretsmanager.ErrCodeLimitExceededException, aerr.Error())
case secretsmanager.ErrCodeEncryptionFailure:
fmt.Println(secretsmanager.ErrCodeEncryptionFailure, aerr.Error())
case secretsmanager.ErrCodeResourceExistsException:
fmt.Println(secretsmanager.ErrCodeResourceExistsException, aerr.Error())
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeMalformedPolicyDocumentException:
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())
}
} 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 a secret
//
// The following example shows how to delete a secret. The secret stays in your account
// in a deprecated and inaccessible state until the recovery window ends. After the
// date and time in the DeletionDate response field has passed, you can no longer recover
// this secret with restore-secret.
func ExampleSecretsManager_DeleteSecret_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.DeleteSecretInput{
RecoveryWindowInDays: aws.Int64(7),
SecretId: aws.String("MyTestDatabaseSecret1"),
}
result, err := svc.DeleteSecret(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.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 details of a secret
//
// The following example shows how to get the details about a secret.
func ExampleSecretsManager_DescribeSecret_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.DescribeSecretInput{
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.DescribeSecret(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())
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 generate a random password
//
// The following example shows how to request a randomly generated password. This example
// includes the optional flags to require spaces and at least one character of each
// included type. It specifies a length of 20 characters.
func ExampleSecretsManager_GetRandomPassword_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.GetRandomPasswordInput{
IncludeSpace: aws.Bool(true),
PasswordLength: aws.Int64(20),
RequireEachIncludedType: aws.Bool(true),
}
result, err := svc.GetRandomPassword(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 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
// of the secret that has the AWSPREVIOUS staging label attached. If you want to retrieve
// the AWSCURRENT version of the secret, then you can omit the VersionStage parameter
// because it defaults to AWSCURRENT.
func ExampleSecretsManager_GetSecretValue_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.GetSecretValueInput{
SecretId: aws.String("MyTestDatabaseSecret"),
VersionStage: aws.String("AWSPREVIOUS"),
}
result, err := svc.GetSecretValue(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.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeDecryptionFailure:
fmt.Println(secretsmanager.ErrCodeDecryptionFailure, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 list all of the secret versions associated with a secret
//
// The following example shows how to retrieve a list of all of the versions of a secret,
// including those without any staging labels.
func ExampleSecretsManager_ListSecretVersionIds_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.ListSecretVersionIdsInput{
IncludeDeprecated: aws.Bool(true),
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.ListSecretVersionIds(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeInvalidNextTokenException:
fmt.Println(secretsmanager.ErrCodeInvalidNextTokenException, aerr.Error())
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 list the secrets in your account
//
// The following example shows how to list all of the secrets in your account.
func ExampleSecretsManager_ListSecrets_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.ListSecretsInput{}
result, err := svc.ListSecrets(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidNextTokenException:
fmt.Println(secretsmanager.ErrCodeInvalidNextTokenException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 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,
// you can use the update-secret command.
func ExampleSecretsManager_PutSecretValue_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.PutSecretValueInput{
ClientRequestToken: aws.String("EXAMPLE2-90ab-cdef-fedc-ba987EXAMPLE"),
SecretId: aws.String("MyTestDatabaseSecret"),
SecretString: aws.String("{\"username\":\"david\",\"password\":\"BnQw!XDWgaEeT9XGTT29\"}"),
}
result, err := svc.PutSecretValue(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeLimitExceededException:
fmt.Println(secretsmanager.ErrCodeLimitExceededException, aerr.Error())
case secretsmanager.ErrCodeEncryptionFailure:
fmt.Println(secretsmanager.ErrCodeEncryptionFailure, aerr.Error())
case secretsmanager.ErrCodeResourceExistsException:
fmt.Println(secretsmanager.ErrCodeResourceExistsException, aerr.Error())
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 restore a previously deleted secret
//
// The following example shows how to restore a secret that you previously scheduled
// for deletion.
func ExampleSecretsManager_RestoreSecret_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.RestoreSecretInput{
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.RestoreSecret(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.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 configure rotation for a secret
//
// The following example configures rotation for a secret by providing the ARN of a
// Lambda rotation function (which must already exist) and the number of days between
// rotation. The first rotation happens immediately upon completion of this command.
// The rotation function runs asynchronously in the background.
func ExampleSecretsManager_RotateSecret_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.RotateSecretInput{
RotationLambdaARN: aws.String("arn:aws:lambda:us-west-2:123456789012:function:MyTestDatabaseRotationLambda"),
RotationRules: &secretsmanager.RotationRulesType{
AutomaticallyAfterDays: aws.Int64(30),
},
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.RotateSecret(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.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 request an immediate rotation for a secret
//
// The following example requests an immediate invocation of the secret's Lambda rotation
// function. It assumes that the specified secret already has rotation configured. The
// rotation function runs asynchronously in the background.
func ExampleSecretsManager_RotateSecret_shared01() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.RotateSecretInput{
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.RotateSecret(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.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 add tags to a secret
//
// The following example shows how to attach two tags each with a Key and Value to a
// secret. There is no output from this API. To see the result, use the DescribeSecret
// operation.
func ExampleSecretsManager_TagResource_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.TagResourceInput{
SecretId: aws.String("MyExampleSecret"),
Tags: []*secretsmanager.Tag{
{
Key: aws.String("FirstTag"),
Value: aws.String("SomeValue"),
},
{
Key: aws.String("SecondTag"),
Value: aws.String("AnotherValue"),
},
},
}
result, err := svc.TagResource(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.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 remove tags from a secret
//
// The following example shows how to remove two tags from a secret's metadata. For
// each, both the tag and the associated value are removed. There is no output from
// this API. To see the result, use the DescribeSecret operation.
func ExampleSecretsManager_UntagResource_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.UntagResourceInput{
SecretId: aws.String("MyTestDatabaseSecret"),
TagKeys: []*string{
aws.String("FirstTag"),
aws.String("SecondTag"),
},
}
result, err := svc.UntagResource(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.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 update the description of a secret
//
// The following example shows how to modify the description of a secret.
func ExampleSecretsManager_UpdateSecret_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.UpdateSecretInput{
ClientRequestToken: aws.String("EXAMPLE1-90ab-cdef-fedc-ba987EXAMPLE"),
Description: aws.String("This is a new description for the secret."),
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.UpdateSecret(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeLimitExceededException:
fmt.Println(secretsmanager.ErrCodeLimitExceededException, aerr.Error())
case secretsmanager.ErrCodeEncryptionFailure:
fmt.Println(secretsmanager.ErrCodeEncryptionFailure, aerr.Error())
case secretsmanager.ErrCodeResourceExistsException:
fmt.Println(secretsmanager.ErrCodeResourceExistsException, aerr.Error())
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeMalformedPolicyDocumentException:
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 update the KMS key associated with a secret
//
// This example shows how to update the KMS customer managed key (CMK) used to encrypt
// the secret value. The KMS CMK must be in the same region as the secret.
func ExampleSecretsManager_UpdateSecret_shared01() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.UpdateSecretInput{
KmsKeyId: aws.String("arn:aws:kms:us-west-2:123456789012:key/EXAMPLE2-90ab-cdef-fedc-ba987EXAMPLE"),
SecretId: aws.String("MyTestDatabaseSecret"),
}
result, err := svc.UpdateSecret(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeLimitExceededException:
fmt.Println(secretsmanager.ErrCodeLimitExceededException, aerr.Error())
case secretsmanager.ErrCodeEncryptionFailure:
fmt.Println(secretsmanager.ErrCodeEncryptionFailure, aerr.Error())
case secretsmanager.ErrCodeResourceExistsException:
fmt.Println(secretsmanager.ErrCodeResourceExistsException, aerr.Error())
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeMalformedPolicyDocumentException:
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 create a new version of the encrypted secret value
//
// The following example shows how to create a new version of the secret by updating
// the SecretString field. Alternatively, you can use the put-secret-value operation.
func ExampleSecretsManager_UpdateSecret_shared02() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.UpdateSecretInput{
SecretId: aws.String("MyTestDatabaseSecret"),
SecretString: aws.String("{JSON STRING WITH CREDENTIALS}"),
}
result, err := svc.UpdateSecret(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case secretsmanager.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeLimitExceededException:
fmt.Println(secretsmanager.ErrCodeLimitExceededException, aerr.Error())
case secretsmanager.ErrCodeEncryptionFailure:
fmt.Println(secretsmanager.ErrCodeEncryptionFailure, aerr.Error())
case secretsmanager.ErrCodeResourceExistsException:
fmt.Println(secretsmanager.ErrCodeResourceExistsException, aerr.Error())
case secretsmanager.ErrCodeResourceNotFoundException:
fmt.Println(secretsmanager.ErrCodeResourceNotFoundException, aerr.Error())
case secretsmanager.ErrCodeMalformedPolicyDocumentException:
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 add a staging label attached to a version of a secret
//
// The following example shows you how to add a staging label to a version of a secret.
// You can review the results by running the operation ListSecretVersionIds and viewing
// the VersionStages response field for the affected version.
func ExampleSecretsManager_UpdateSecretVersionStage_shared00() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.UpdateSecretVersionStageInput{
MoveToVersionId: aws.String("EXAMPLE1-90ab-cdef-fedc-ba987SECRET1"),
SecretId: aws.String("MyTestDatabaseSecret"),
VersionStage: aws.String("STAGINGLABEL1"),
}
result, err := svc.UpdateSecretVersionStage(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.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeLimitExceededException:
fmt.Println(secretsmanager.ErrCodeLimitExceededException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 a staging label attached to a version of a secret
//
// The following example shows you how to delete a staging label that is attached to
// a version of a secret. You can review the results by running the operation ListSecretVersionIds
// and viewing the VersionStages response field for the affected version.
func ExampleSecretsManager_UpdateSecretVersionStage_shared01() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.UpdateSecretVersionStageInput{
RemoveFromVersionId: aws.String("EXAMPLE1-90ab-cdef-fedc-ba987SECRET1"),
SecretId: aws.String("MyTestDatabaseSecret"),
VersionStage: aws.String("STAGINGLABEL1"),
}
result, err := svc.UpdateSecretVersionStage(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.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeLimitExceededException:
fmt.Println(secretsmanager.ErrCodeLimitExceededException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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 move a staging label from one version of a secret to another
//
// The following example shows you how to move a staging label that is attached to one
// version of a secret to a different version. You can review the results by running
// the operation ListSecretVersionIds and viewing the VersionStages response field for
// the affected version.
func ExampleSecretsManager_UpdateSecretVersionStage_shared02() {
svc := secretsmanager.New(session.New())
input := &secretsmanager.UpdateSecretVersionStageInput{
MoveToVersionId: aws.String("EXAMPLE2-90ab-cdef-fedc-ba987SECRET2"),
RemoveFromVersionId: aws.String("EXAMPLE1-90ab-cdef-fedc-ba987SECRET1"),
SecretId: aws.String("MyTestDatabaseSecret"),
VersionStage: aws.String("AWSCURRENT"),
}
result, err := svc.UpdateSecretVersionStage(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.ErrCodeInvalidParameterException:
fmt.Println(secretsmanager.ErrCodeInvalidParameterException, aerr.Error())
case secretsmanager.ErrCodeInvalidRequestException:
fmt.Println(secretsmanager.ErrCodeInvalidRequestException, aerr.Error())
case secretsmanager.ErrCodeLimitExceededException:
fmt.Println(secretsmanager.ErrCodeLimitExceededException, aerr.Error())
case secretsmanager.ErrCodeInternalServiceError:
fmt.Println(secretsmanager.ErrCodeInternalServiceError, 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)
}
+58
View File
@@ -0,0 +1,58 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// +build go1.10,integration
package secretsmanager_test
import (
"context"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting/integration"
"github.com/aws/aws-sdk-go/service/secretsmanager"
)
var _ aws.Config
var _ awserr.Error
var _ request.Request
func TestInteg_00_ListSecrets(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-west-2")
svc := secretsmanager.New(sess)
params := &secretsmanager.ListSecretsInput{}
_, err := svc.ListSecretsWithContext(ctx, params)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestInteg_01_DescribeSecret(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-west-2")
svc := secretsmanager.New(sess)
params := &secretsmanager.DescribeSecretInput{
SecretId: aws.String("fake-secret-id"),
}
_, err := svc.DescribeSecretWithContext(ctx, params)
if err == nil {
t.Fatalf("expect request to fail")
}
aerr, ok := err.(awserr.RequestFailure)
if !ok {
t.Fatalf("expect awserr, was %T", err)
}
if len(aerr.Code()) == 0 {
t.Errorf("expect non-empty error code")
}
if v := aerr.Code(); v == request.ErrCodeSerialization {
t.Errorf("expect API error code got serialization failure")
}
}
@@ -68,6 +68,10 @@ type SecretsManagerAPI interface {
CreateSecretWithContext(aws.Context, *secretsmanager.CreateSecretInput, ...request.Option) (*secretsmanager.CreateSecretOutput, error)
CreateSecretRequest(*secretsmanager.CreateSecretInput) (*request.Request, *secretsmanager.CreateSecretOutput)
DeleteResourcePolicy(*secretsmanager.DeleteResourcePolicyInput) (*secretsmanager.DeleteResourcePolicyOutput, error)
DeleteResourcePolicyWithContext(aws.Context, *secretsmanager.DeleteResourcePolicyInput, ...request.Option) (*secretsmanager.DeleteResourcePolicyOutput, error)
DeleteResourcePolicyRequest(*secretsmanager.DeleteResourcePolicyInput) (*request.Request, *secretsmanager.DeleteResourcePolicyOutput)
DeleteSecret(*secretsmanager.DeleteSecretInput) (*secretsmanager.DeleteSecretOutput, error)
DeleteSecretWithContext(aws.Context, *secretsmanager.DeleteSecretInput, ...request.Option) (*secretsmanager.DeleteSecretOutput, error)
DeleteSecretRequest(*secretsmanager.DeleteSecretInput) (*request.Request, *secretsmanager.DeleteSecretOutput)
@@ -80,6 +84,10 @@ type SecretsManagerAPI interface {
GetRandomPasswordWithContext(aws.Context, *secretsmanager.GetRandomPasswordInput, ...request.Option) (*secretsmanager.GetRandomPasswordOutput, error)
GetRandomPasswordRequest(*secretsmanager.GetRandomPasswordInput) (*request.Request, *secretsmanager.GetRandomPasswordOutput)
GetResourcePolicy(*secretsmanager.GetResourcePolicyInput) (*secretsmanager.GetResourcePolicyOutput, error)
GetResourcePolicyWithContext(aws.Context, *secretsmanager.GetResourcePolicyInput, ...request.Option) (*secretsmanager.GetResourcePolicyOutput, error)
GetResourcePolicyRequest(*secretsmanager.GetResourcePolicyInput) (*request.Request, *secretsmanager.GetResourcePolicyOutput)
GetSecretValue(*secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error)
GetSecretValueWithContext(aws.Context, *secretsmanager.GetSecretValueInput, ...request.Option) (*secretsmanager.GetSecretValueOutput, error)
GetSecretValueRequest(*secretsmanager.GetSecretValueInput) (*request.Request, *secretsmanager.GetSecretValueOutput)
@@ -98,6 +106,10 @@ type SecretsManagerAPI interface {
ListSecretsPages(*secretsmanager.ListSecretsInput, func(*secretsmanager.ListSecretsOutput, bool) bool) error
ListSecretsPagesWithContext(aws.Context, *secretsmanager.ListSecretsInput, func(*secretsmanager.ListSecretsOutput, bool) bool, ...request.Option) error
PutResourcePolicy(*secretsmanager.PutResourcePolicyInput) (*secretsmanager.PutResourcePolicyOutput, error)
PutResourcePolicyWithContext(aws.Context, *secretsmanager.PutResourcePolicyInput, ...request.Option) (*secretsmanager.PutResourcePolicyOutput, error)
PutResourcePolicyRequest(*secretsmanager.PutResourcePolicyInput) (*request.Request, *secretsmanager.PutResourcePolicyOutput)
PutSecretValue(*secretsmanager.PutSecretValueInput) (*secretsmanager.PutSecretValueOutput, error)
PutSecretValueWithContext(aws.Context, *secretsmanager.PutSecretValueInput, ...request.Option) (*secretsmanager.PutSecretValueOutput, error)
PutSecretValueRequest(*secretsmanager.PutSecretValueInput) (*request.Request, *secretsmanager.PutSecretValueOutput)
+4 -2
View File
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "secretsmanager" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "secretsmanager" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "Secrets Manager" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the SecretsManager client with a session.
@@ -58,6 +59,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,