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 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.
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.
// 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 {
			fmt.Println(err.Error())
		}
		return
	}
	fmt.Println(result)
}
func ExampleSecretsManager_TagResource_shared00 ( ) { svc := secretsmanager . New ( session . New ( ) ) input := & secretsmanager . TagResourceInput { SecretId : aws . String ( " " ) , Tags : [ ] * secretsmanager . Tag { { Key : aws . String ( " " ) , Value : aws . String ( " " ) , } , { Key : aws . String ( " " ) , Value : aws . String ( " " ) , } , } , } 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 { fmt . Println ( err . Error ( ) ) } return } fmt . Println ( result ) }
To add tags to a secret
To add tags to a secret
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.