AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

CopyImageInput

import "github.com/aws/aws-sdk-go/service/ec2"

type CopyImageInput struct { ClientToken *string `type:"string"` Description *string `type:"string"` DryRun *bool `locationName:"dryRun" type:"boolean"` Encrypted *bool `locationName:"encrypted" type:"boolean"` KmsKeyId *string `locationName:"kmsKeyId" type:"string"` Name *string `type:"string" required:"true"` SourceImageId *string `type:"string" required:"true"` SourceRegion *string `type:"string" required:"true"` }

Contains the parameters for CopyImage.

ClientToken

Type: *string

Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) in the Amazon Elastic Compute Cloud User Guide.

Description

Type: *string

A description for the new AMI in the destination region.

DryRun

Type: *bool

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Encrypted

Type: *bool

Specifies whether the destination snapshots of the copied image should be encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot create an unencrypted copy of an encrypted snapshot. The default CMK for EBS is used unless you specify a non-default AWS Key Management Service (AWS KMS) CMK using KmsKeyId. For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) in the Amazon Elastic Compute Cloud User Guide.

KmsKeyId

Type: *string

An identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted flag must also be set.

The CMK identifier may be provided in any of the following formats:

  • Key ID

  • Key alias, in the form alias/ExampleAlias

  • ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.

  • ARN using key alias. The alias ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.

AWS parses KmsKeyId asynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. This action will eventually report failure.

The specified CMK must exist in the region that the snapshot is being copied to.

Name

Type: *string

The name of the new AMI in the destination region.

Name is a required field

SourceImageId

Type: *string

The ID of the AMI to copy.

SourceImageId is a required field

SourceRegion

Type: *string

The name of the region that contains the AMI to copy.

SourceRegion is a required field

Method

GoString

func (s CopyImageInput) GoString() string

GoString returns the string representation

SetClientToken

func (s *CopyImageInput) SetClientToken(v string) *CopyImageInput

SetClientToken sets the ClientToken field's value.

SetDescription

func (s *CopyImageInput) SetDescription(v string) *CopyImageInput

SetDescription sets the Description field's value.

SetDryRun

func (s *CopyImageInput) SetDryRun(v bool) *CopyImageInput

SetDryRun sets the DryRun field's value.

SetEncrypted

func (s *CopyImageInput) SetEncrypted(v bool) *CopyImageInput

SetEncrypted sets the Encrypted field's value.

SetKmsKeyId

func (s *CopyImageInput) SetKmsKeyId(v string) *CopyImageInput

SetKmsKeyId sets the KmsKeyId field's value.

SetName

func (s *CopyImageInput) SetName(v string) *CopyImageInput

SetName sets the Name field's value.

SetSourceImageId

func (s *CopyImageInput) SetSourceImageId(v string) *CopyImageInput

SetSourceImageId sets the SourceImageId field's value.

SetSourceRegion

func (s *CopyImageInput) SetSourceRegion(v string) *CopyImageInput

SetSourceRegion sets the SourceRegion field's value.

String

func (s CopyImageInput) String() string

String returns the string representation

Validate

func (s *CopyImageInput) Validate() error

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

On this page: