1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package appstream 4 5import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 9 "github.com/aws/aws-sdk-go-v2/service/appstream/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Creates an image builder. An image builder is a virtual machine that is used to 15// create an image. The initial state of the builder is PENDING. When it is ready, 16// the state is RUNNING. 17func (c *Client) CreateImageBuilder(ctx context.Context, params *CreateImageBuilderInput, optFns ...func(*Options)) (*CreateImageBuilderOutput, error) { 18 if params == nil { 19 params = &CreateImageBuilderInput{} 20 } 21 22 result, metadata, err := c.invokeOperation(ctx, "CreateImageBuilder", params, optFns, addOperationCreateImageBuilderMiddlewares) 23 if err != nil { 24 return nil, err 25 } 26 27 out := result.(*CreateImageBuilderOutput) 28 out.ResultMetadata = metadata 29 return out, nil 30} 31 32type CreateImageBuilderInput struct { 33 34 // The instance type to use when launching the image builder. The following 35 // instance types are available: 36 // 37 // * stream.standard.small 38 // 39 // * 40 // stream.standard.medium 41 // 42 // * stream.standard.large 43 // 44 // * stream.compute.large 45 // 46 // * 47 // stream.compute.xlarge 48 // 49 // * stream.compute.2xlarge 50 // 51 // * stream.compute.4xlarge 52 // 53 // * 54 // stream.compute.8xlarge 55 // 56 // * stream.memory.large 57 // 58 // * stream.memory.xlarge 59 // 60 // * 61 // stream.memory.2xlarge 62 // 63 // * stream.memory.4xlarge 64 // 65 // * stream.memory.8xlarge 66 // 67 // * 68 // stream.memory.z1d.large 69 // 70 // * stream.memory.z1d.xlarge 71 // 72 // * 73 // stream.memory.z1d.2xlarge 74 // 75 // * stream.memory.z1d.3xlarge 76 // 77 // * 78 // stream.memory.z1d.6xlarge 79 // 80 // * stream.memory.z1d.12xlarge 81 // 82 // * 83 // stream.graphics-design.large 84 // 85 // * stream.graphics-design.xlarge 86 // 87 // * 88 // stream.graphics-design.2xlarge 89 // 90 // * stream.graphics-design.4xlarge 91 // 92 // * 93 // stream.graphics-desktop.2xlarge 94 // 95 // * stream.graphics.g4dn.xlarge 96 // 97 // * 98 // stream.graphics.g4dn.2xlarge 99 // 100 // * stream.graphics.g4dn.4xlarge 101 // 102 // * 103 // stream.graphics.g4dn.8xlarge 104 // 105 // * stream.graphics.g4dn.12xlarge 106 // 107 // * 108 // stream.graphics.g4dn.16xlarge 109 // 110 // * stream.graphics-pro.4xlarge 111 // 112 // * 113 // stream.graphics-pro.8xlarge 114 // 115 // * stream.graphics-pro.16xlarge 116 // 117 // This member is required. 118 InstanceType *string 119 120 // A unique name for the image builder. 121 // 122 // This member is required. 123 Name *string 124 125 // The list of interface VPC endpoint (interface endpoint) objects. Administrators 126 // can connect to the image builder only through the specified endpoints. 127 AccessEndpoints []types.AccessEndpoint 128 129 // The version of the AppStream 2.0 agent to use for this image builder. To use the 130 // latest version of the AppStream 2.0 agent, specify [LATEST]. 131 AppstreamAgentVersion *string 132 133 // The description to display. 134 Description *string 135 136 // The image builder name to display. 137 DisplayName *string 138 139 // The name of the directory and organizational unit (OU) to use to join the image 140 // builder to a Microsoft Active Directory domain. 141 DomainJoinInfo *types.DomainJoinInfo 142 143 // Enables or disables default internet access for the image builder. 144 EnableDefaultInternetAccess *bool 145 146 // The Amazon Resource Name (ARN) of the IAM role to apply to the image builder. To 147 // assume a role, the image builder calls the AWS Security Token Service (STS) 148 // AssumeRole API operation and passes the ARN of the role to use. The operation 149 // creates a new session with temporary credentials. AppStream 2.0 retrieves the 150 // temporary credentials and creates the appstream_machine_role credential profile 151 // on the instance. For more information, see Using an IAM Role to Grant 152 // Permissions to Applications and Scripts Running on AppStream 2.0 Streaming 153 // Instances 154 // (https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html) 155 // in the Amazon AppStream 2.0 Administration Guide. 156 IamRoleArn *string 157 158 // The ARN of the public, private, or shared image to use. 159 ImageArn *string 160 161 // The name of the image used to create the image builder. 162 ImageName *string 163 164 // The tags to associate with the image builder. A tag is a key-value pair, and the 165 // value is optional. For example, Environment=Test. If you do not specify a value, 166 // Environment=. Generally allowed characters are: letters, numbers, and spaces 167 // representable in UTF-8, and the following special characters: _ . : / = + \ - @ 168 // If you do not specify a value, the value is set to an empty string. For more 169 // information about tags, see Tagging Your Resources 170 // (https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html) 171 // in the Amazon AppStream 2.0 Administration Guide. 172 Tags map[string]string 173 174 // The VPC configuration for the image builder. You can specify only one subnet. 175 VpcConfig *types.VpcConfig 176} 177 178type CreateImageBuilderOutput struct { 179 180 // Information about the image builder. 181 ImageBuilder *types.ImageBuilder 182 183 // Metadata pertaining to the operation's result. 184 ResultMetadata middleware.Metadata 185} 186 187func addOperationCreateImageBuilderMiddlewares(stack *middleware.Stack, options Options) (err error) { 188 err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateImageBuilder{}, middleware.After) 189 if err != nil { 190 return err 191 } 192 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateImageBuilder{}, middleware.After) 193 if err != nil { 194 return err 195 } 196 if err = addSetLoggerMiddleware(stack, options); err != nil { 197 return err 198 } 199 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 200 return err 201 } 202 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 203 return err 204 } 205 if err = addResolveEndpointMiddleware(stack, options); err != nil { 206 return err 207 } 208 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 209 return err 210 } 211 if err = addRetryMiddlewares(stack, options); err != nil { 212 return err 213 } 214 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 215 return err 216 } 217 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 218 return err 219 } 220 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 221 return err 222 } 223 if err = addClientUserAgent(stack); err != nil { 224 return err 225 } 226 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 227 return err 228 } 229 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 230 return err 231 } 232 if err = addOpCreateImageBuilderValidationMiddleware(stack); err != nil { 233 return err 234 } 235 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateImageBuilder(options.Region), middleware.Before); err != nil { 236 return err 237 } 238 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 239 return err 240 } 241 if err = addResponseErrorMiddleware(stack); err != nil { 242 return err 243 } 244 if err = addRequestResponseLogging(stack, options); err != nil { 245 return err 246 } 247 return nil 248} 249 250func newServiceMetadataMiddleware_opCreateImageBuilder(region string) *awsmiddleware.RegisterServiceMetadata { 251 return &awsmiddleware.RegisterServiceMetadata{ 252 Region: region, 253 ServiceID: ServiceID, 254 SigningName: "appstream", 255 OperationName: "CreateImageBuilder", 256 } 257} 258