1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
|
// Code generated by smithy-go-codegen DO NOT EDIT.
package opsworks
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/opsworks/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a specified layer.
//
// Required Permissions: To use this action, an IAM user must have a Manage
// permissions level for the stack, or an attached policy that explicitly grants
// permissions. For more information on user permissions, see [Managing User Permissions].
//
// [Managing User Permissions]: https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html
func (c *Client) UpdateLayer(ctx context.Context, params *UpdateLayerInput, optFns ...func(*Options)) (*UpdateLayerOutput, error) {
if params == nil {
params = &UpdateLayerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateLayer", params, optFns, c.addOperationUpdateLayerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateLayerOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateLayerInput struct {
// The layer ID.
//
// This member is required.
LayerId *string
// One or more user-defined key/value pairs to be added to the stack attributes.
Attributes map[string]string
// Whether to automatically assign an [Elastic IP address] to the layer's instances. For more
// information, see [How to Edit a Layer].
//
// [How to Edit a Layer]: https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html
// [Elastic IP address]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
AutoAssignElasticIps *bool
// For stacks that are running in a VPC, whether to automatically assign a public
// IP address to the layer's instances. For more information, see [How to Edit a Layer].
//
// [How to Edit a Layer]: https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html
AutoAssignPublicIps *bool
// Specifies CloudWatch Logs configuration options for the layer. For more
// information, see CloudWatchLogsLogStream.
CloudWatchLogsConfiguration *types.CloudWatchLogsConfiguration
// The ARN of an IAM profile to be used for all of the layer's EC2 instances. For
// more information about IAM ARNs, see [Using Identifiers].
//
// [Using Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
CustomInstanceProfileArn *string
// A JSON-formatted string containing custom stack configuration and deployment
// attributes to be installed on the layer's instances. For more information, see [Using Custom JSON]
// .
//
// [Using Custom JSON]: https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json-override.html
CustomJson *string
// A LayerCustomRecipes object that specifies the layer's custom recipes.
CustomRecipes *types.Recipes
// An array containing the layer's custom security group IDs.
CustomSecurityGroupIds []string
// Whether to disable auto healing for the layer.
EnableAutoHealing *bool
// Whether to install operating system and package updates when the instance
// boots. The default value is true . To control when updates are installed, set
// this value to false . You must then update your instances manually by using CreateDeployment to
// run the update_dependencies stack command or manually running yum (Amazon
// Linux) or apt-get (Ubuntu) on the instances.
//
// We strongly recommend using the default value of true , to ensure that your
// instances have the latest security updates.
InstallUpdatesOnBoot *bool
//
LifecycleEventConfiguration *types.LifecycleEventConfiguration
// The layer name, which is used by the console. Layer names can be a maximum of
// 32 characters.
Name *string
// An array of Package objects that describe the layer's packages.
Packages []string
// For custom layers only, use this parameter to specify the layer's short name,
// which is used internally by OpsWorks Stacks and by Chef. The short name is also
// used as the name for the directory where your app files are installed. It can
// have a maximum of 32 characters and must be in the following format:
// /\A[a-z0-9\-\_\.]+\Z/.
//
// Built-in layer short names are defined by OpsWorks Stacks. For more
// information, see the [Layer reference]in the OpsWorks User Guide.
//
// [Layer reference]: https://docs.aws.amazon.com/opsworks/latest/userguide/layers.html
Shortname *string
// Whether to use Amazon EBS-optimized instances.
UseEbsOptimizedInstances *bool
// A VolumeConfigurations object that describes the layer's Amazon EBS volumes.
VolumeConfigurations []types.VolumeConfiguration
noSmithyDocumentSerde
}
type UpdateLayerOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateLayerMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateLayer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateLayer{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateLayer"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addTimeOffsetBuild(stack, c); err != nil {
return err
}
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addOpUpdateLayerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLayer(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateLayer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "UpdateLayer",
}
}
|