Struct: kms.CreateAliasInput

import "../ibm-cos-sdk-go/service/kms"

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, request.Validator, s3manager.WriterReadFrom

Structure Field Summary collapse

Service Operations collapse

Structure Field Details

AliasName *string `min:"1" type:"string" required:"true"`

Specifies the alias name. This value must begin with alias/ followed by a name, such as alias/ExampleAlias.

Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

The AliasName value must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin with alias/aws/. The alias/aws/ prefix is reserved for Amazon Web Services managed keys (docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk).

AliasName is a required field

TargetKeyId *string `min:"1" type:"string" required:"true"`

Associates the alias with the specified customer managed key (docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). The KMS key must be in the same Amazon Web Services Region.

A valid key ID is required. If you supply a null or empty string value, this operation returns an error.

For help finding the key ID and ARN, see Finding the Key ID and ARN (docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) in the Key Management Service Developer Guide .

Specify the key ID or key ARN of the KMS key.

For example:

  • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.

TargetKeyId is a required field

_ struct{} `type:"structure"`

Method Details

func (s CreateAliasInput) GoString() string

GoString returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



8630
8631
8632
// File 'service/kms/api.go', line 8630

func (s CreateAliasInput) GoString() string { return s.String() }

func (s *CreateAliasInput) SetAliasName(v string) *CreateAliasInput

SetAliasName sets the AliasName field's value.



8657
8658
8659
8660
// File 'service/kms/api.go', line 8657

func (s *CreateAliasInput) SetAliasName(v string) *CreateAliasInput { s.AliasName = &v return s }

func (s *CreateAliasInput) SetTargetKeyId(v string) *CreateAliasInput

SetTargetKeyId sets the TargetKeyId field's value.



8663
8664
8665
8666
// File 'service/kms/api.go', line 8663

func (s *CreateAliasInput) SetTargetKeyId(v string) *CreateAliasInput { s.TargetKeyId = &v return s }

func (s CreateAliasInput) String() string

String returns the string representation.

API parameter values that are decorated as “sensitive” in the API will not be included in the string output. The member name will be present, but the value will be replaced with “sensitive”.



8621
8622
8623
// File 'service/kms/api.go', line 8621

func (s CreateAliasInput) String() string { return awsutil.Prettify(s) }

func (s *CreateAliasInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.



8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
// File 'service/kms/api.go', line 8635

func (s *CreateAliasInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"} if s.AliasName == nil { invalidParams.Add(request.NewErrParamRequired("AliasName")) } if s.AliasName != nil && len(*s.AliasName) < 1 { invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) } if s.TargetKeyId == nil { invalidParams.Add(request.NewErrParamRequired("TargetKeyId")) } if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil }