AWS OpsWorks

2015/06/24 - AWS OpsWorks - 1 new9 updated api methods

DescribeAgentVersions (new) Link ¶

Describes the available AWS OpsWorks agent versions. You must specify a stack ID or a configuration manager. DescribeAgentVersions returns a list of available agent versions for the specified stack or configuration manager.

Request Syntax

client.describe_agent_versions(
    StackId='string',
    ConfigurationManager={
        'Name': 'string',
        'Version': 'string'
    }
)
type StackId:

string

param StackId:

The stack ID.

type ConfigurationManager:

dict

param ConfigurationManager:

The configuration manager.

  • Name (string) --

    The name. This parameter must be set to "Chef".

  • Version (string) --

    The Chef version. This parameter must be set to 0.9, 11.4, or 11.10. The default value is 11.4.

rtype:

dict

returns:

Response Syntax

{
    'AgentVersions': [
        {
            'Version': 'string',
            'ConfigurationManager': {
                'Name': 'string',
                'Version': 'string'
            }
        },
    ]
}

Response Structure

  • (dict) --

    Contains the response to a DescribeAgentVersions request.

    • AgentVersions (list) --

      The agent versions for the specified stack or configuration manager. Note that this value is the complete version number, not the abbreviated number used by the console.

      • (dict) --

        Describes an agent version.

        • Version (string) --

          The agent version.

        • ConfigurationManager (dict) --

          The configuration manager.

          • Name (string) --

            The name. This parameter must be set to "Chef".

          • Version (string) --

            The Chef version. This parameter must be set to 0.9, 11.4, or 11.10. The default value is 11.4.

CloneStack (updated) Link ¶
Changes (request)
{'AgentVersion': 'string'}

Creates a clone of a specified stack. For more information, see Clone a Stack. By default, all parameters are set to the values used by the parent stack.

Required Permissions: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Request Syntax

client.clone_stack(
    SourceStackId='string',
    Name='string',
    Region='string',
    VpcId='string',
    Attributes={
        'string': 'string'
    },
    ServiceRoleArn='string',
    DefaultInstanceProfileArn='string',
    DefaultOs='string',
    HostnameTheme='string',
    DefaultAvailabilityZone='string',
    DefaultSubnetId='string',
    CustomJson='string',
    ConfigurationManager={
        'Name': 'string',
        'Version': 'string'
    },
    ChefConfiguration={
        'ManageBerkshelf': True|False,
        'BerkshelfVersion': 'string'
    },
    UseCustomCookbooks=True|False,
    UseOpsworksSecurityGroups=True|False,
    CustomCookbooksSource={
        'Type': 'git'|'svn'|'archive'|'s3',
        'Url': 'string',
        'Username': 'string',
        'Password': 'string',
        'SshKey': 'string',
        'Revision': 'string'
    },
    DefaultSshKeyName='string',
    ClonePermissions=True|False,
    CloneAppIds=[
        'string',
    ],
    DefaultRootDeviceType='ebs'|'instance-store',
    AgentVersion='string'
)
type SourceStackId:

string

param SourceStackId:

[REQUIRED]

The source stack ID.

type Name:

string

param Name:

The cloned stack name.

type Region:

string

param Region:

The cloned stack AWS region, such as "us-east-1". For more information about AWS regions, see Regions and Endpoints.

type VpcId:

string

param VpcId:

The ID of the VPC that the cloned stack is to be launched into. It must be in the specified region. All instances are launched into this VPC, and you cannot change the ID later.

  • If your account supports EC2 Classic, the default value is no VPC.

  • If your account does not support EC2 Classic, the default value is the default VPC for the specified region.

If the VPC ID corresponds to a default VPC and you have specified either the DefaultAvailabilityZone or the DefaultSubnetId parameter only, AWS OpsWorks infers the value of the other parameter. If you specify neither parameter, AWS OpsWorks sets these parameters to the first valid Availability Zone for the specified region and the corresponding default VPC subnet ID, respectively.

If you specify a nondefault VPC ID, note the following:

  • It must belong to a VPC in your account that is in the specified region.

  • You must specify a value for DefaultSubnetId.

For more information on how to use AWS OpsWorks with a VPC, see Running a Stack in a VPC. For more information on default VPC and EC2 Classic, see Supported Platforms.

type Attributes:

dict

param Attributes:

A list of stack attributes and values as key/value pairs to be added to the cloned stack.

  • (string) --

    • (string) --

type ServiceRoleArn:

string

param ServiceRoleArn:

[REQUIRED]

The stack AWS Identity and Access Management (IAM) role, which allows AWS OpsWorks to work with AWS resources on your behalf. You must set this parameter to the Amazon Resource Name (ARN) for an existing IAM role. If you create a stack by using the AWS OpsWorks console, it creates the role for you. You can obtain an existing stack's IAM ARN programmatically by calling DescribePermissions. For more information about IAM ARNs, see Using Identifiers.

type DefaultInstanceProfileArn:

string

param DefaultInstanceProfileArn:

The ARN of an IAM profile that is the default profile for all of the stack's EC2 instances. For more information about IAM ARNs, see Using Identifiers.

type DefaultOs:

string

param DefaultOs:

The stack's operating system, which must be set to one of the following.

  • A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2015.03, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.

  • Microsoft Windows Server 2012 R2 Base.

  • A custom AMI: Custom. You specify the custom AMI you want to use when you create instances. For more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

The default option is the parent stack's operating system. For more information on the supported operating systems, see AWS OpsWorks Operating Systems.

type HostnameTheme:

string

param HostnameTheme:

The stack's host name theme, with spaces are replaced by underscores. The theme is used to generate host names for the stack's instances. By default, HostnameTheme is set to Layer_Dependent, which creates host names by appending integers to the layer's short name. The other themes are:

  • Baked_Goods

  • Clouds

  • Europe_Cities

  • Fruits

  • Greek_Deities

  • Legendary_creatures_from_Japan

  • Planets_and_Moons

  • Roman_Deities

  • Scottish_Islands

  • US_Cities

  • Wild_Cats

To obtain a generated host name, call GetHostNameSuggestion, which returns a host name based on the current theme.

type DefaultAvailabilityZone:

string

param DefaultAvailabilityZone:

The cloned stack's default Availability Zone, which must be in the specified region. For more information, see Regions and Endpoints. If you also specify a value for DefaultSubnetId, the subnet must be in the same zone. For more information, see the VpcId parameter description.

type DefaultSubnetId:

string

param DefaultSubnetId:

The stack's default VPC subnet ID. This parameter is required if you specify a value for the VpcId parameter. All instances are launched into this subnet unless you specify otherwise when you create the instance. If you also specify a value for DefaultAvailabilityZone, the subnet must be in that zone. For information on default values and when this parameter is required, see the VpcId parameter description.

type CustomJson:

string

param CustomJson:

A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values. The string should be in the following format and must escape characters such as '"':

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes

type ConfigurationManager:

dict

param ConfigurationManager:

The configuration manager. When you clone a Linux stack we recommend that you use the configuration manager to specify the Chef version: 0.9, 11.4, or 11.10. The default value is currently 11.10.

  • Name (string) --

    The name. This parameter must be set to "Chef".

  • Version (string) --

    The Chef version. This parameter must be set to 0.9, 11.4, or 11.10. The default value is 11.4.

type ChefConfiguration:

dict

param ChefConfiguration:

A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more information, see Create a New Stack.

  • ManageBerkshelf (boolean) --

    Whether to enable Berkshelf.

  • BerkshelfVersion (string) --

    The Berkshelf version.

type UseCustomCookbooks:

boolean

param UseCustomCookbooks:

Whether to use custom cookbooks.

type UseOpsworksSecurityGroups:

boolean

param UseOpsworksSecurityGroups:

Whether to associate the AWS OpsWorks built-in security groups with the stack's layers.

AWS OpsWorks provides a standard set of built-in security groups, one for each layer, which are associated with layers by default. With UseOpsworksSecurityGroups you can instead provide your own custom security groups. UseOpsworksSecurityGroups has the following settings:

  • True - AWS OpsWorks automatically associates the appropriate built-in security group with each layer (default setting). You can associate additional security groups with a layer after you create it but you cannot delete the built-in security group.

  • False - AWS OpsWorks does not associate built-in security groups with layers. You must create appropriate EC2 security groups and associate a security group with each layer that you create. However, you can still manually associate a built-in security group with a layer on creation; custom security groups are required only for those layers that need custom settings.

For more information, see Create a New Stack.

type CustomCookbooksSource:

dict

param CustomCookbooksSource:

Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps or Custom Recipes and Cookbooks.

  • Type (string) --

    The repository type.

  • Url (string) --

    The source URL.

  • Username (string) --

    This parameter depends on the repository type.

    • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.

    • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.

  • Password (string) --

    When included in a request, the parameter depends on the repository type.

    • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.

    • For HTTP bundles and Subversion repositories, set Password to the password.

    For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.

    In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual value.

  • SshKey (string) --

    In requests, the repository's SSH key.

    In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual value.

  • Revision (string) --

    The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.

type DefaultSshKeyName:

string

param DefaultSshKeyName:

A default Amazon EC2 key pair name. The default value is none. If you specify a key pair name, AWS OpsWorks installs the public key on the instance and you can use the private key with an SSH client to log in to the instance. For more information, see Using SSH to Communicate with an Instance and Managing SSH Access. You can override this setting by specifying a different key pair, or no key pair, when you create an instance.

type ClonePermissions:

boolean

param ClonePermissions:

Whether to clone the source stack's permissions.

type CloneAppIds:

list

param CloneAppIds:

A list of source stack app IDs to be included in the cloned stack.

  • (string) --

type DefaultRootDeviceType:

string

param DefaultRootDeviceType:

The default root device type. This value is used by default for all instances in the cloned stack, but you can override it when you create an instance. For more information, see Storage for the Root Device.

type AgentVersion:

string

param AgentVersion:

The default AWS OpsWorks agent version. You have the following options:

  • Auto-update - Set this parameter to LATEST. AWS OpsWorks automatically installs new agent versions on the stack's instances as soon as they are available.

  • Fixed version - Set this parameter to your preferred agent version. To update the agent version, you must edit the stack configuration and specify a new version. AWS OpsWorks then automatically installs that version on the stack's instances.

The default setting is LATEST. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call DescribeAgentVersions.

rtype:

dict

returns:

Response Syntax

{
    'StackId': 'string'
}

Response Structure

  • (dict) --

    Contains the response to a CloneStack request.

    • StackId (string) --

      The cloned stack ID.

CreateDeployment (updated) Link ¶
Changes (request)
{'Command': {'Name': {'setup', 'configure'}}}

Runs deployment or stack commands. For more information, see Deploying Apps and Run Stack Commands.

Required Permissions: To use this action, an IAM user must have a Deploy or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Request Syntax

client.create_deployment(
    StackId='string',
    AppId='string',
    InstanceIds=[
        'string',
    ],
    Command={
        'Name': 'install_dependencies'|'update_dependencies'|'update_custom_cookbooks'|'execute_recipes'|'configure'|'setup'|'deploy'|'rollback'|'start'|'stop'|'restart'|'undeploy',
        'Args': {
            'string': [
                'string',
            ]
        }
    },
    Comment='string',
    CustomJson='string'
)
type StackId:

string

param StackId:

[REQUIRED]

The stack ID.

type AppId:

string

param AppId:

The app ID. This parameter is required for app deployments, but not for other deployment commands.

type InstanceIds:

list

param InstanceIds:

The instance IDs for the deployment targets.

  • (string) --

type Command:

dict

param Command:

[REQUIRED]

A DeploymentCommand object that specifies the deployment command and any associated arguments.

  • Name (string) -- [REQUIRED]

    Specifies the operation. You can specify only one command.

    For stacks, the following commands are available:

    • execute_recipes: Execute one or more recipes. To specify the recipes, set an Args parameter named recipes to the list of recipes to be executed. For example, to execute phpapp::appsetup, set Args to {"recipes":["phpapp::appsetup"]}.

    • install_dependencies: Install the stack's dependencies.

    • update_custom_cookbooks: Update the stack's custom cookbooks.

    • update_dependencies: Update the stack's dependencies.

    For apps, the following commands are available:

    • deploy: Deploy an app. Ruby on Rails apps have an optional Args parameter named migrate. Set Args to {"migrate":["true"]} to migrate the database. The default setting is {"migrate":["false"]}.

    • rollback Roll the app back to the previous version. When you update an app, AWS OpsWorks stores the previous version, up to a maximum of five versions. You can use this command to roll an app back as many as four versions.

    • start: Start the app's web or application server.

    • stop: Stop the app's web or application server.

    • restart: Restart the app's web or application server.

    • undeploy: Undeploy the app.

  • Args (dict) --

    The arguments of those commands that take arguments. It should be set to a JSON object with the following format:

    {"arg_name1" : ["value1", "value2", ...], "arg_name2" : ["value1", "value2", ...], ...}

    The update_dependencies command takes two arguments:

    • upgrade_os_to - Specifies the desired Amazon Linux version for instances whose OS you want to upgrade, such as Amazon Linux 2014.09. You must also set the allow_reboot argument to true.

    • allow_reboot - Specifies whether to allow AWS OpsWorks to reboot the instances if necessary, after installing the updates. This argument can be set to either true or false. The default value is false.

    For example, to upgrade an instance to Amazon Linux 2014.09, set Args to the following.

    `` { "upgrade_os_to":["Amazon Linux 2014.09"], "allow_reboot":["true"] }``

    • (string) --

      • (list) --

        • (string) --

type Comment:

string

param Comment:

A user-defined comment.

type CustomJson:

string

param CustomJson:

A string that contains user-defined, custom JSON. It is used to override the corresponding default stack configuration JSON values. The string should be in the following format and must escape characters such as '"':

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

rtype:

dict

returns:

Response Syntax

{
    'DeploymentId': 'string'
}

Response Structure

  • (dict) --

    Contains the response to a CreateDeployment request.

    • DeploymentId (string) --

      The deployment ID, which can be used with other requests to identify the deployment.

CreateInstance (updated) Link ¶
Changes (request)
{'AgentVersion': 'string'}

Creates an instance in a specified stack. For more information, see Adding an Instance to a 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.

Request Syntax

client.create_instance(
    StackId='string',
    LayerIds=[
        'string',
    ],
    InstanceType='string',
    AutoScalingType='load'|'timer',
    Hostname='string',
    Os='string',
    AmiId='string',
    SshKeyName='string',
    AvailabilityZone='string',
    VirtualizationType='string',
    SubnetId='string',
    Architecture='x86_64'|'i386',
    RootDeviceType='ebs'|'instance-store',
    BlockDeviceMappings=[
        {
            'DeviceName': 'string',
            'NoDevice': 'string',
            'VirtualName': 'string',
            'Ebs': {
                'SnapshotId': 'string',
                'Iops': 123,
                'VolumeSize': 123,
                'VolumeType': 'gp2'|'io1'|'standard',
                'DeleteOnTermination': True|False
            }
        },
    ],
    InstallUpdatesOnBoot=True|False,
    EbsOptimized=True|False,
    AgentVersion='string'
)
type StackId:

string

param StackId:

[REQUIRED]

The stack ID.

type LayerIds:

list

param LayerIds:

[REQUIRED]

An array that contains the instance's layer IDs.

  • (string) --

type InstanceType:

string

param InstanceType:

[REQUIRED]

The instance type, such as t2.micro. For a list of supported instance types, open the stack in the console, choose Instances, and choose + Instance. The Size list contains the currently supported types. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.

type AutoScalingType:

string

param AutoScalingType:

For load-based or time-based instances, the type. Windows stacks can use only time-based instances.

type Hostname:

string

param Hostname:

The instance host name.

type Os:

string

param Os:

The instance's operating system, which must be set to one of the following.

  • A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2015.03, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.

  • Microsoft Windows Server 2012 R2 Base.

  • A custom AMI: Custom.

For more information on the supported operating systems, see AWS OpsWorks Operating Systems.

The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. For more information on the supported operating systems, see Operating Systems <http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html>`__For more information on how to use custom AMIs with AWS OpsWorks, see `Using Custom AMIs.

type AmiId:

string

param AmiId:

A custom AMI ID to be used to create the instance. The AMI should be based on one of the supported operating systems. For more information, see Using Custom AMIs.

type SshKeyName:

string

param SshKeyName:

The instance's Amazon EC2 key-pair name.

type AvailabilityZone:

string

param AvailabilityZone:

The instance Availability Zone. For more information, see Regions and Endpoints.

type VirtualizationType:

string

param VirtualizationType:

The instance's virtualization type, paravirtual or hvm.

type SubnetId:

string

param SubnetId:

The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.

type Architecture:

string

param Architecture:

The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.

type RootDeviceType:

string

param RootDeviceType:

The instance root device type. For more information, see Storage for the Root Device.

type BlockDeviceMappings:

list

param BlockDeviceMappings:

An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping.

  • (dict) --

    Describes a block device mapping. This data type maps directly to the Amazon EC2 BlockDeviceMapping data type.

    • DeviceName (string) --

      The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.

    • NoDevice (string) --

      Suppresses the specified device included in the AMI's block device mapping.

    • VirtualName (string) --

      The virtual device name. For more information, see BlockDeviceMapping.

    • Ebs (dict) --

      An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.

      • SnapshotId (string) --

        The snapshot ID.

      • Iops (integer) --

        The number of I/O operations per second (IOPS) that the volume supports. For more information, see EbsBlockDevice.

      • VolumeSize (integer) --

        The volume size, in GiB. For more information, see EbsBlockDevice.

      • VolumeType (string) --

        The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

      • DeleteOnTermination (boolean) --

        Whether the volume is deleted on instance termination.

type InstallUpdatesOnBoot:

boolean

param InstallUpdatesOnBoot:

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 by manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances.

type EbsOptimized:

boolean

param EbsOptimized:

Whether to create an Amazon EBS-optimized instance.

type AgentVersion:

string

param AgentVersion:

The default AWS OpsWorks agent version. You have the following options:

  • INHERIT - Use the stack's default agent version setting.

  • version_number - Use the specified agent version. This value overrides the stack's default setting. To update the agent version, edit the instance configuration and specify a new version. AWS OpsWorks then automatically installs that version on the instance.

The default setting is INHERIT. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call DescribeAgentVersions.

rtype:

dict

returns:

Response Syntax

{
    'InstanceId': 'string'
}

Response Structure

  • (dict) --

    Contains the response to a CreateInstance request.

    • InstanceId (string) --

      The instance ID.

CreateStack (updated) Link ¶
Changes (request)
{'AgentVersion': 'string'}

Creates a new stack. For more information, see Create a New Stack.

Required Permissions: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Request Syntax

client.create_stack(
    Name='string',
    Region='string',
    VpcId='string',
    Attributes={
        'string': 'string'
    },
    ServiceRoleArn='string',
    DefaultInstanceProfileArn='string',
    DefaultOs='string',
    HostnameTheme='string',
    DefaultAvailabilityZone='string',
    DefaultSubnetId='string',
    CustomJson='string',
    ConfigurationManager={
        'Name': 'string',
        'Version': 'string'
    },
    ChefConfiguration={
        'ManageBerkshelf': True|False,
        'BerkshelfVersion': 'string'
    },
    UseCustomCookbooks=True|False,
    UseOpsworksSecurityGroups=True|False,
    CustomCookbooksSource={
        'Type': 'git'|'svn'|'archive'|'s3',
        'Url': 'string',
        'Username': 'string',
        'Password': 'string',
        'SshKey': 'string',
        'Revision': 'string'
    },
    DefaultSshKeyName='string',
    DefaultRootDeviceType='ebs'|'instance-store',
    AgentVersion='string'
)
type Name:

string

param Name:

[REQUIRED]

The stack name.

type Region:

string

param Region:

[REQUIRED]

The stack's AWS region, such as "us-east-1". For more information about Amazon regions, see Regions and Endpoints.

type VpcId:

string

param VpcId:

The ID of the VPC that the stack is to be launched into. The VPC must be in the stack's region. All instances are launched into this VPC. You cannot change the ID later.

  • If your account supports EC2-Classic, the default value is no VPC.

  • If your account does not support EC2-Classic, the default value is the default VPC for the specified region.

If the VPC ID corresponds to a default VPC and you have specified either the DefaultAvailabilityZone or the DefaultSubnetId parameter only, AWS OpsWorks infers the value of the other parameter. If you specify neither parameter, AWS OpsWorks sets these parameters to the first valid Availability Zone for the specified region and the corresponding default VPC subnet ID, respectively.

If you specify a nondefault VPC ID, note the following:

  • It must belong to a VPC in your account that is in the specified region.

  • You must specify a value for DefaultSubnetId.

For more information on how to use AWS OpsWorks with a VPC, see Running a Stack in a VPC. For more information on default VPC and EC2-Classic, see Supported Platforms.

type Attributes:

dict

param Attributes:

One or more user-defined key-value pairs to be added to the stack attributes.

  • (string) --

    • (string) --

type ServiceRoleArn:

string

param ServiceRoleArn:

[REQUIRED]

The stack's AWS Identity and Access Management (IAM) role, which allows AWS OpsWorks to work with AWS resources on your behalf. You must set this parameter to the Amazon Resource Name (ARN) for an existing IAM role. For more information about IAM ARNs, see Using Identifiers.

type DefaultInstanceProfileArn:

string

param DefaultInstanceProfileArn:

[REQUIRED]

The Amazon Resource Name (ARN) of an IAM profile that is the default profile for all of the stack's EC2 instances. For more information about IAM ARNs, see Using Identifiers.

type DefaultOs:

string

param DefaultOs:

The stack's default operating system, which is installed on every instance unless you specify a different operating system when you create the instance. You can specify one of the following.

  • A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2015.03, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.

  • Microsoft Windows Server 2012 R2 Base.

  • A custom AMI: Custom. You specify the custom AMI you want to use when you create instances. For more information, see Using Custom AMIs.

The default option is the current Amazon Linux version. For more information on the supported operating systems, see AWS OpsWorks Operating Systems.

type HostnameTheme:

string

param HostnameTheme:

The stack's host name theme, with spaces replaced by underscores. The theme is used to generate host names for the stack's instances. By default, HostnameTheme is set to Layer_Dependent, which creates host names by appending integers to the layer's short name. The other themes are:

  • Baked_Goods

  • Clouds

  • Europe_Cities

  • Fruits

  • Greek_Deities

  • Legendary_creatures_from_Japan

  • Planets_and_Moons

  • Roman_Deities

  • Scottish_Islands

  • US_Cities

  • Wild_Cats

To obtain a generated host name, call GetHostNameSuggestion, which returns a host name based on the current theme.

type DefaultAvailabilityZone:

string

param DefaultAvailabilityZone:

The stack's default Availability Zone, which must be in the specified region. For more information, see Regions and Endpoints. If you also specify a value for DefaultSubnetId, the subnet must be in the same zone. For more information, see the VpcId parameter description.

type DefaultSubnetId:

string

param DefaultSubnetId:

The stack's default VPC subnet ID. This parameter is required if you specify a value for the VpcId parameter. All instances are launched into this subnet unless you specify otherwise when you create the instance. If you also specify a value for DefaultAvailabilityZone, the subnet must be in that zone. For information on default values and when this parameter is required, see the VpcId parameter description.

type CustomJson:

string

param CustomJson:

A string that contains user-defined, custom JSON. It can be used to override the corresponding default stack configuration attribute values or to pass data to recipes. The string should be in the following escape characters such as '"':

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

type ConfigurationManager:

dict

param ConfigurationManager:

The configuration manager. When you clone a stack we recommend that you use the configuration manager to specify the Chef version: 0.9, 11.4, or 11.10. The default value is currently 11.4.

  • Name (string) --

    The name. This parameter must be set to "Chef".

  • Version (string) --

    The Chef version. This parameter must be set to 0.9, 11.4, or 11.10. The default value is 11.4.

type ChefConfiguration:

dict

param ChefConfiguration:

A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more information, see Create a New Stack.

  • ManageBerkshelf (boolean) --

    Whether to enable Berkshelf.

  • BerkshelfVersion (string) --

    The Berkshelf version.

type UseCustomCookbooks:

boolean

param UseCustomCookbooks:

Whether the stack uses custom cookbooks.

type UseOpsworksSecurityGroups:

boolean

param UseOpsworksSecurityGroups:

Whether to associate the AWS OpsWorks built-in security groups with the stack's layers.

AWS OpsWorks provides a standard set of built-in security groups, one for each layer, which are associated with layers by default. With UseOpsworksSecurityGroups you can instead provide your own custom security groups. UseOpsworksSecurityGroups has the following settings:

  • True - AWS OpsWorks automatically associates the appropriate built-in security group with each layer (default setting). You can associate additional security groups with a layer after you create it, but you cannot delete the built-in security group.

  • False - AWS OpsWorks does not associate built-in security groups with layers. You must create appropriate EC2 security groups and associate a security group with each layer that you create. However, you can still manually associate a built-in security group with a layer on creation; custom security groups are required only for those layers that need custom settings.

For more information, see Create a New Stack.

type CustomCookbooksSource:

dict

param CustomCookbooksSource:

Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps or Custom Recipes and Cookbooks.

  • Type (string) --

    The repository type.

  • Url (string) --

    The source URL.

  • Username (string) --

    This parameter depends on the repository type.

    • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.

    • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.

  • Password (string) --

    When included in a request, the parameter depends on the repository type.

    • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.

    • For HTTP bundles and Subversion repositories, set Password to the password.

    For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.

    In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual value.

  • SshKey (string) --

    In requests, the repository's SSH key.

    In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual value.

  • Revision (string) --

    The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.

type DefaultSshKeyName:

string

param DefaultSshKeyName:

A default Amazon EC2 key pair name. The default value is none. If you specify a key pair name, AWS OpsWorks installs the public key on the instance and you can use the private key with an SSH client to log in to the instance. For more information, see Using SSH to Communicate with an Instance and Managing SSH Access. You can override this setting by specifying a different key pair, or no key pair, when you create an instance.

type DefaultRootDeviceType:

string

param DefaultRootDeviceType:

The default root device type. This value is the default for all instances in the stack, but you can override it when you create an instance. The default option is instance-store. For more information, see Storage for the Root Device.

type AgentVersion:

string

param AgentVersion:

The default AWS OpsWorks agent version. You have the following options:

  • Auto-update - Set this parameter to LATEST. AWS OpsWorks automatically installs new agent versions on the stack's instances as soon as they are available.

  • Fixed version - Set this parameter to your preferred agent version. To update the agent version, you must edit the stack configuration and specify a new version. AWS OpsWorks then automatically installs that version on the stack's instances.

The default setting is LATEST. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call DescribeAgentVersions.

rtype:

dict

returns:

Response Syntax

{
    'StackId': 'string'
}

Response Structure

  • (dict) --

    Contains the response to a CreateStack request.

    • StackId (string) --

      The stack ID, which is an opaque string that you use to identify the stack when performing actions such as DescribeStacks.

DescribeDeployments (updated) Link ¶
Changes (response)
{'Deployments': {'Command': {'Name': {'setup', 'configure'}}}}

Requests a description of a specified set of deployments.

Required Permissions: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Request Syntax

client.describe_deployments(
    StackId='string',
    AppId='string',
    DeploymentIds=[
        'string',
    ]
)
type StackId:

string

param StackId:

The stack ID. If you include this parameter, DescribeDeployments returns a description of the commands associated with the specified stack.

type AppId:

string

param AppId:

The app ID. If you include this parameter, DescribeDeployments returns a description of the commands associated with the specified app.

type DeploymentIds:

list

param DeploymentIds:

An array of deployment IDs to be described. If you include this parameter, DescribeDeployments returns a description of the specified deployments. Otherwise, it returns a description of every deployment.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Deployments': [
        {
            'DeploymentId': 'string',
            'StackId': 'string',
            'AppId': 'string',
            'CreatedAt': 'string',
            'CompletedAt': 'string',
            'Duration': 123,
            'IamUserArn': 'string',
            'Comment': 'string',
            'Command': {
                'Name': 'install_dependencies'|'update_dependencies'|'update_custom_cookbooks'|'execute_recipes'|'configure'|'setup'|'deploy'|'rollback'|'start'|'stop'|'restart'|'undeploy',
                'Args': {
                    'string': [
                        'string',
                    ]
                }
            },
            'Status': 'string',
            'CustomJson': 'string',
            'InstanceIds': [
                'string',
            ]
        },
    ]
}

Response Structure

  • (dict) --

    Contains the response to a DescribeDeployments request.

    • Deployments (list) --

      An array of Deployment objects that describe the deployments.

      • (dict) --

        Describes a deployment of a stack or app.

        • DeploymentId (string) --

          The deployment ID.

        • StackId (string) --

          The stack ID.

        • AppId (string) --

          The app ID.

        • CreatedAt (string) --

          Date when the deployment was created.

        • CompletedAt (string) --

          Date when the deployment completed.

        • Duration (integer) --

          The deployment duration.

        • IamUserArn (string) --

          The user's IAM ARN.

        • Comment (string) --

          A user-defined comment.

        • Command (dict) --

          Used to specify a stack or deployment command.

          • Name (string) --

            Specifies the operation. You can specify only one command.

            For stacks, the following commands are available:

            • execute_recipes: Execute one or more recipes. To specify the recipes, set an Args parameter named recipes to the list of recipes to be executed. For example, to execute phpapp::appsetup, set Args to {"recipes":["phpapp::appsetup"]}.

            • install_dependencies: Install the stack's dependencies.

            • update_custom_cookbooks: Update the stack's custom cookbooks.

            • update_dependencies: Update the stack's dependencies.

            For apps, the following commands are available:

            • deploy: Deploy an app. Ruby on Rails apps have an optional Args parameter named migrate. Set Args to {"migrate":["true"]} to migrate the database. The default setting is {"migrate":["false"]}.

            • rollback Roll the app back to the previous version. When you update an app, AWS OpsWorks stores the previous version, up to a maximum of five versions. You can use this command to roll an app back as many as four versions.

            • start: Start the app's web or application server.

            • stop: Stop the app's web or application server.

            • restart: Restart the app's web or application server.

            • undeploy: Undeploy the app.

          • Args (dict) --

            The arguments of those commands that take arguments. It should be set to a JSON object with the following format:

            {"arg_name1" : ["value1", "value2", ...], "arg_name2" : ["value1", "value2", ...], ...}

            The update_dependencies command takes two arguments:

            • upgrade_os_to - Specifies the desired Amazon Linux version for instances whose OS you want to upgrade, such as Amazon Linux 2014.09. You must also set the allow_reboot argument to true.

            • allow_reboot - Specifies whether to allow AWS OpsWorks to reboot the instances if necessary, after installing the updates. This argument can be set to either true or false. The default value is false.

            For example, to upgrade an instance to Amazon Linux 2014.09, set Args to the following.

            `` { "upgrade_os_to":["Amazon Linux 2014.09"], "allow_reboot":["true"] }``

            • (string) --

              • (list) --

                • (string) --

        • Status (string) --

          The deployment status:

          • running

          • successful

          • failed

        • CustomJson (string) --

          A string that contains user-defined custom JSON. It can be used to override the corresponding default stack configuration attribute values for stack or to pass data to recipes. The string should be in the following format and must escape characters such as '"':

          "{\"key1\": \"value1\", \"key2\": \"value2\",...}"

          For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

        • InstanceIds (list) --

          The IDs of the target instances.

          • (string) --

DescribeInstances (updated) Link ¶
Changes (response)
{'Instances': {'AgentVersion': 'string', 'Platform': 'string'}}

Requests a description of a set of instances.

Required Permissions: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Request Syntax

client.describe_instances(
    StackId='string',
    LayerId='string',
    InstanceIds=[
        'string',
    ]
)
type StackId:

string

param StackId:

A stack ID. If you use this parameter, DescribeInstances returns descriptions of the instances associated with the specified stack.

type LayerId:

string

param LayerId:

A layer ID. If you use this parameter, DescribeInstances returns descriptions of the instances associated with the specified layer.

type InstanceIds:

list

param InstanceIds:

An array of instance IDs to be described. If you use this parameter, DescribeInstances returns a description of the specified instances. Otherwise, it returns a description of every instance.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Instances': [
        {
            'AgentVersion': 'string',
            'AmiId': 'string',
            'Architecture': 'x86_64'|'i386',
            'AutoScalingType': 'load'|'timer',
            'AvailabilityZone': 'string',
            'BlockDeviceMappings': [
                {
                    'DeviceName': 'string',
                    'NoDevice': 'string',
                    'VirtualName': 'string',
                    'Ebs': {
                        'SnapshotId': 'string',
                        'Iops': 123,
                        'VolumeSize': 123,
                        'VolumeType': 'gp2'|'io1'|'standard',
                        'DeleteOnTermination': True|False
                    }
                },
            ],
            'CreatedAt': 'string',
            'EbsOptimized': True|False,
            'Ec2InstanceId': 'string',
            'ElasticIp': 'string',
            'Hostname': 'string',
            'InfrastructureClass': 'string',
            'InstallUpdatesOnBoot': True|False,
            'InstanceId': 'string',
            'InstanceProfileArn': 'string',
            'InstanceType': 'string',
            'LastServiceErrorId': 'string',
            'LayerIds': [
                'string',
            ],
            'Os': 'string',
            'Platform': 'string',
            'PrivateDns': 'string',
            'PrivateIp': 'string',
            'PublicDns': 'string',
            'PublicIp': 'string',
            'RegisteredBy': 'string',
            'ReportedAgentVersion': 'string',
            'ReportedOs': {
                'Family': 'string',
                'Name': 'string',
                'Version': 'string'
            },
            'RootDeviceType': 'ebs'|'instance-store',
            'RootDeviceVolumeId': 'string',
            'SecurityGroupIds': [
                'string',
            ],
            'SshHostDsaKeyFingerprint': 'string',
            'SshHostRsaKeyFingerprint': 'string',
            'SshKeyName': 'string',
            'StackId': 'string',
            'Status': 'string',
            'SubnetId': 'string',
            'VirtualizationType': 'paravirtual'|'hvm'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the response to a DescribeInstances request.

    • Instances (list) --

      An array of Instance objects that describe the instances.

      • (dict) --

        Describes an instance.

        • AgentVersion (string) --

          The agent version. This parameter is set to INHERIT if the instance inherits the default stack setting or to a a version number for a fixed agent version.

        • AmiId (string) --

          A custom AMI ID to be used to create the instance. For more information, see Instances

        • Architecture (string) --

          The instance architecture: "i386" or "x86_64".

        • AutoScalingType (string) --

          For load-based or time-based instances, the type.

        • AvailabilityZone (string) --

          The instance Availability Zone. For more information, see Regions and Endpoints.

        • BlockDeviceMappings (list) --

          An array of BlockDeviceMapping objects that specify the instance's block device mappings.

          • (dict) --

            Describes a block device mapping. This data type maps directly to the Amazon EC2 BlockDeviceMapping data type.

            • DeviceName (string) --

              The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks will provide the correct device name.

            • NoDevice (string) --

              Suppresses the specified device included in the AMI's block device mapping.

            • VirtualName (string) --

              The virtual device name. For more information, see BlockDeviceMapping.

            • Ebs (dict) --

              An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.

              • SnapshotId (string) --

                The snapshot ID.

              • Iops (integer) --

                The number of I/O operations per second (IOPS) that the volume supports. For more information, see EbsBlockDevice.

              • VolumeSize (integer) --

                The volume size, in GiB. For more information, see EbsBlockDevice.

              • VolumeType (string) --

                The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes.

              • DeleteOnTermination (boolean) --

                Whether the volume is deleted on instance termination.

        • CreatedAt (string) --

          The time that the instance was created.

        • EbsOptimized (boolean) --

          Whether this is an Amazon EBS-optimized instance.

        • Ec2InstanceId (string) --

          The ID of the associated Amazon EC2 instance.

        • ElasticIp (string) --

          The instance Elastic IP address.

        • Hostname (string) --

          The instance host name.

        • InfrastructureClass (string) --

          For registered instances, the infrastructure class: ec2 or on-premises.

        • InstallUpdatesOnBoot (boolean) --

          Whether to install operating system and package updates when the instance boots. The default value is true. If this value is set to false, you must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or by manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances.

        • InstanceId (string) --

          The instance ID.

        • InstanceProfileArn (string) --

          The ARN of the instance's IAM profile. For more information about IAM ARNs, see Using Identifiers.

        • InstanceType (string) --

          The instance type, such as t2.micro.

        • LastServiceErrorId (string) --

          The ID of the last service error. For more information, call DescribeServiceErrors.

        • LayerIds (list) --

          An array containing the instance layer IDs.

          • (string) --

        • Os (string) --

          The instance's operating system.

        • Platform (string) --

          The instance's platform.

        • PrivateDns (string) --

          The The instance's private DNS name.

        • PrivateIp (string) --

          The instance's private IP address.

        • PublicDns (string) --

          The instance public DNS name.

        • PublicIp (string) --

          The instance public IP address.

        • RegisteredBy (string) --

          For registered instances, who performed the registration.

        • ReportedAgentVersion (string) --

          The instance's reported AWS OpsWorks agent version.

        • ReportedOs (dict) --

          For registered instances, the reported operating system.

          • Family (string) --

            The operating system family.

          • Name (string) --

            The operating system name.

          • Version (string) --

            The operating system version.

        • RootDeviceType (string) --

          The instance's root device type. For more information, see Storage for the Root Device.

        • RootDeviceVolumeId (string) --

          The root device volume ID.

        • SecurityGroupIds (list) --

          An array containing the instance security group IDs.

          • (string) --

        • SshHostDsaKeyFingerprint (string) --

          The SSH key's Deep Security Agent (DSA) fingerprint.

        • SshHostRsaKeyFingerprint (string) --

          The SSH key's RSA fingerprint.

        • SshKeyName (string) --

          The instance's Amazon EC2 key-pair name.

        • StackId (string) --

          The stack ID.

        • Status (string) --

          The instance status:

          • booting

          • connection_lost

          • online

          • pending

          • rebooting

          • requested

          • running_setup

          • setup_failed

          • shutting_down

          • start_failed

          • stopped

          • stopping

          • terminated

          • terminating

        • SubnetId (string) --

          The instance's subnet ID; applicable only if the stack is running in a VPC.

        • VirtualizationType (string) --

          The instance's virtualization type: paravirtual or hvm.

DescribeStacks (updated) Link ¶
Changes (response)
{'Stacks': {'AgentVersion': 'string'}}

Requests a description of one or more stacks.

Required Permissions: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.

Request Syntax

client.describe_stacks(
    StackIds=[
        'string',
    ]
)
type StackIds:

list

param StackIds:

An array of stack IDs that specify the stacks to be described. If you omit this parameter, DescribeStacks returns a description of every stack.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Stacks': [
        {
            'StackId': 'string',
            'Name': 'string',
            'Arn': 'string',
            'Region': 'string',
            'VpcId': 'string',
            'Attributes': {
                'string': 'string'
            },
            'ServiceRoleArn': 'string',
            'DefaultInstanceProfileArn': 'string',
            'DefaultOs': 'string',
            'HostnameTheme': 'string',
            'DefaultAvailabilityZone': 'string',
            'DefaultSubnetId': 'string',
            'CustomJson': 'string',
            'ConfigurationManager': {
                'Name': 'string',
                'Version': 'string'
            },
            'ChefConfiguration': {
                'ManageBerkshelf': True|False,
                'BerkshelfVersion': 'string'
            },
            'UseCustomCookbooks': True|False,
            'UseOpsworksSecurityGroups': True|False,
            'CustomCookbooksSource': {
                'Type': 'git'|'svn'|'archive'|'s3',
                'Url': 'string',
                'Username': 'string',
                'Password': 'string',
                'SshKey': 'string',
                'Revision': 'string'
            },
            'DefaultSshKeyName': 'string',
            'CreatedAt': 'string',
            'DefaultRootDeviceType': 'ebs'|'instance-store',
            'AgentVersion': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Contains the response to a DescribeStacks request.

    • Stacks (list) --

      An array of Stack objects that describe the stacks.

      • (dict) --

        Describes a stack.

        • StackId (string) --

          The stack ID.

        • Name (string) --

          The stack name.

        • Arn (string) --

          The stack's ARN.

        • Region (string) --

          The stack AWS region, such as "us-east-1". For more information about AWS regions, see Regions and Endpoints.

        • VpcId (string) --

          The VPC ID; applicable only if the stack is running in a VPC.

        • Attributes (dict) --

          The stack's attributes.

          • (string) --

            • (string) --

        • ServiceRoleArn (string) --

          The stack AWS Identity and Access Management (IAM) role.

        • DefaultInstanceProfileArn (string) --

          The ARN of an IAM profile that is the default profile for all of the stack's EC2 instances. For more information about IAM ARNs, see Using Identifiers.

        • DefaultOs (string) --

          The stack's default operating system.

        • HostnameTheme (string) --

          The stack host name theme, with spaces replaced by underscores.

        • DefaultAvailabilityZone (string) --

          The stack's default Availability Zone. For more information, see Regions and Endpoints.

        • DefaultSubnetId (string) --

          The default subnet ID; applicable only if the stack is running in a VPC.

        • CustomJson (string) --

          A JSON object that contains user-defined attributes to be added to the stack configuration and deployment attributes. You can use custom JSON to override the corresponding default stack configuration attribute values or to pass data to recipes. The string should be in the following format and must escape characters such as '"':

          "{\"key1\": \"value1\", \"key2\": \"value2\",...}"

          For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

        • ConfigurationManager (dict) --

          The configuration manager.

          • Name (string) --

            The name. This parameter must be set to "Chef".

          • Version (string) --

            The Chef version. This parameter must be set to 0.9, 11.4, or 11.10. The default value is 11.4.

        • ChefConfiguration (dict) --

          A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version. For more information, see Create a New Stack.

          • ManageBerkshelf (boolean) --

            Whether to enable Berkshelf.

          • BerkshelfVersion (string) --

            The Berkshelf version.

        • UseCustomCookbooks (boolean) --

          Whether the stack uses custom cookbooks.

        • UseOpsworksSecurityGroups (boolean) --

          Whether the stack automatically associates the AWS OpsWorks built-in security groups with the stack's layers.

        • CustomCookbooksSource (dict) --

          Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps or Custom Recipes and Cookbooks.

          • Type (string) --

            The repository type.

          • Url (string) --

            The source URL.

          • Username (string) --

            This parameter depends on the repository type.

            • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.

            • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.

          • Password (string) --

            When included in a request, the parameter depends on the repository type.

            • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.

            • For HTTP bundles and Subversion repositories, set Password to the password.

            For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.

            In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual value.

          • SshKey (string) --

            In requests, the repository's SSH key.

            In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual value.

          • Revision (string) --

            The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.

        • DefaultSshKeyName (string) --

          A default Amazon EC2 key pair for the stack's instances. You can override this value when you create or update an instance.

        • CreatedAt (string) --

          The date when the stack was created.

        • DefaultRootDeviceType (string) --

          The default root device type. This value is used by default for all instances in the stack, but you can override it when you create an instance. For more information, see Storage for the Root Device.

        • AgentVersion (string) --

          The agent version. This parameter is set to LATEST for auto-update. or a version number for a fixed agent version.

UpdateInstance (updated) Link ¶
Changes (request)
{'AgentVersion': 'string'}

Updates a specified instance.

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.

Request Syntax

client.update_instance(
    InstanceId='string',
    LayerIds=[
        'string',
    ],
    InstanceType='string',
    AutoScalingType='load'|'timer',
    Hostname='string',
    Os='string',
    AmiId='string',
    SshKeyName='string',
    Architecture='x86_64'|'i386',
    InstallUpdatesOnBoot=True|False,
    EbsOptimized=True|False,
    AgentVersion='string'
)
type InstanceId:

string

param InstanceId:

[REQUIRED]

The instance ID.

type LayerIds:

list

param LayerIds:

The instance's layer IDs.

  • (string) --

type InstanceType:

string

param InstanceType:

The instance type, such as t2.micro. For a list of supported instance types, open the stack in the console, choose Instances, and choose + Instance. The Size list contains the currently supported types. For more information, see Instance Families and Types. The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.

type AutoScalingType:

string

param AutoScalingType:

For load-based or time-based instances, the type. Windows stacks can use only time-based instances.

type Hostname:

string

param Hostname:

The instance host name.

type Os:

string

param Os:

The instance's operating system, which must be set to one of the following.

  • A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2015.03, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.

  • Microsoft Windows Server 2012 R2 Base.

  • A custom AMI: Custom.

For more information on the supported operating systems, see AWS OpsWorks Operating Systems.

The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the AmiId parameter to specify the custom AMI that you want to use. For more information on the supported operating systems, see Operating Systems. For more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

type AmiId:

string

param AmiId:

A custom AMI ID to be used to create the instance. The AMI must be based on one of the supported operating systems. For more information, see Instances

type SshKeyName:

string

param SshKeyName:

The instance's Amazon EC2 key name.

type Architecture:

string

param Architecture:

The instance architecture. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.

type InstallUpdatesOnBoot:

boolean

param InstallUpdatesOnBoot:

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 by manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances.

type EbsOptimized:

boolean

param EbsOptimized:

This property cannot be updated.

type AgentVersion:

string

param AgentVersion:

The default AWS OpsWorks agent version. You have the following options:

  • INHERIT - Use the stack's default agent version setting.

  • version_number - Use the specified agent version. This value overrides the stack's default setting. To update the agent version, you must edit the instance configuration and specify a new version. AWS OpsWorks then automatically installs that version on the instance.

The default setting is INHERIT. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call DescribeAgentVersions.

returns:

None

UpdateStack (updated) Link ¶
Changes (request)
{'AgentVersion': 'string'}

Updates a specified stack.

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.

Request Syntax

client.update_stack(
    StackId='string',
    Name='string',
    Attributes={
        'string': 'string'
    },
    ServiceRoleArn='string',
    DefaultInstanceProfileArn='string',
    DefaultOs='string',
    HostnameTheme='string',
    DefaultAvailabilityZone='string',
    DefaultSubnetId='string',
    CustomJson='string',
    ConfigurationManager={
        'Name': 'string',
        'Version': 'string'
    },
    ChefConfiguration={
        'ManageBerkshelf': True|False,
        'BerkshelfVersion': 'string'
    },
    UseCustomCookbooks=True|False,
    CustomCookbooksSource={
        'Type': 'git'|'svn'|'archive'|'s3',
        'Url': 'string',
        'Username': 'string',
        'Password': 'string',
        'SshKey': 'string',
        'Revision': 'string'
    },
    DefaultSshKeyName='string',
    DefaultRootDeviceType='ebs'|'instance-store',
    UseOpsworksSecurityGroups=True|False,
    AgentVersion='string'
)
type StackId:

string

param StackId:

[REQUIRED]

The stack ID.

type Name:

string

param Name:

The stack's new name.

type Attributes:

dict

param Attributes:

One or more user-defined key-value pairs to be added to the stack attributes.

  • (string) --

    • (string) --

type ServiceRoleArn:

string

param ServiceRoleArn:

The stack IAM role, which allows AWS OpsWorks to work with AWS resources on your behalf. You must set this parameter to the ARN for an existing IAM role. For more information about IAM ARNs, see Using Identifiers.

type DefaultInstanceProfileArn:

string

param DefaultInstanceProfileArn:

The ARN of an IAM profile that is the default profile for all of the stack's EC2 instances. For more information about IAM ARNs, see Using Identifiers.

type DefaultOs:

string

param DefaultOs:

The stack's operating system, which must be set to one of the following:

  • A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2015.03, Ubuntu 12.04 LTS, or Ubuntu 14.04 LTS.

  • Microsoft Windows Server 2012 R2 Base.

  • A custom AMI: Custom. You specify the custom AMI you want to use when you create instances. For more information on how to use custom AMIs with OpsWorks, see Using Custom AMIs.

The default option is the stack's current operating system. For more information on the supported operating systems, see AWS OpsWorks Operating Systems.

type HostnameTheme:

string

param HostnameTheme:

The stack's new host name theme, with spaces replaced by underscores. The theme is used to generate host names for the stack's instances. By default, HostnameTheme is set to Layer_Dependent, which creates host names by appending integers to the layer's short name. The other themes are:

  • Baked_Goods

  • Clouds

  • Europe_Cities

  • Fruits

  • Greek_Deities

  • Legendary_creatures_from_Japan

  • Planets_and_Moons

  • Roman_Deities

  • Scottish_Islands

  • US_Cities

  • Wild_Cats

To obtain a generated host name, call GetHostNameSuggestion, which returns a host name based on the current theme.

type DefaultAvailabilityZone:

string

param DefaultAvailabilityZone:

The stack's default Availability Zone, which must be in the stack's region. For more information, see Regions and Endpoints. If you also specify a value for DefaultSubnetId, the subnet must be in the same zone. For more information, see CreateStack.

type DefaultSubnetId:

string

param DefaultSubnetId:

The stack's default VPC subnet ID. This parameter is required if you specify a value for the VpcId parameter. All instances are launched into this subnet unless you specify otherwise when you create the instance. If you also specify a value for DefaultAvailabilityZone, the subnet must be in that zone. For information on default values and when this parameter is required, see the VpcId parameter description.

type CustomJson:

string

param CustomJson:

A string that contains user-defined, custom JSON. It can be used to override the corresponding default stack configuration JSON values or to pass data to recipes. The string should be in the following format and escape characters such as '"':

"{\"key1\": \"value1\", \"key2\": \"value2\",...}"

For more information on custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes.

type ConfigurationManager:

dict

param ConfigurationManager:

The configuration manager. When you clone a stack, we recommend that you use the configuration manager to specify the Chef version: 0.9, 11.4, or 11.10. The default value is currently 11.4.

  • Name (string) --

    The name. This parameter must be set to "Chef".

  • Version (string) --

    The Chef version. This parameter must be set to 0.9, 11.4, or 11.10. The default value is 11.4.

type ChefConfiguration:

dict

param ChefConfiguration:

A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more information, see Create a New Stack.

  • ManageBerkshelf (boolean) --

    Whether to enable Berkshelf.

  • BerkshelfVersion (string) --

    The Berkshelf version.

type UseCustomCookbooks:

boolean

param UseCustomCookbooks:

Whether the stack uses custom cookbooks.

type CustomCookbooksSource:

dict

param CustomCookbooksSource:

Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps or Custom Recipes and Cookbooks.

  • Type (string) --

    The repository type.

  • Url (string) --

    The source URL.

  • Username (string) --

    This parameter depends on the repository type.

    • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.

    • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.

  • Password (string) --

    When included in a request, the parameter depends on the repository type.

    • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.

    • For HTTP bundles and Subversion repositories, set Password to the password.

    For more information on how to safely handle IAM credentials, see http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.

    In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual value.

  • SshKey (string) --

    In requests, the repository's SSH key.

    In responses, AWS OpsWorks returns *****FILTERED***** instead of the actual value.

  • Revision (string) --

    The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.

type DefaultSshKeyName:

string

param DefaultSshKeyName:

A default Amazon EC2 key-pair name. The default value is none. If you specify a key-pair name, AWS OpsWorks installs the public key on the instance and you can use the private key with an SSH client to log in to the instance. For more information, see Using SSH to Communicate with an Instance and Managing SSH Access. You can override this setting by specifying a different key pair, or no key pair, when you create an instance.

type DefaultRootDeviceType:

string

param DefaultRootDeviceType:

The default root device type. This value is used by default for all instances in the stack, but you can override it when you create an instance. For more information, see Storage for the Root Device.

type UseOpsworksSecurityGroups:

boolean

param UseOpsworksSecurityGroups:

Whether to associate the AWS OpsWorks built-in security groups with the stack's layers.

AWS OpsWorks provides a standard set of built-in security groups, one for each layer, which are associated with layers by default. UseOpsworksSecurityGroups allows you to provide your own custom security groups instead of using the built-in groups. UseOpsworksSecurityGroups has the following settings:

  • True - AWS OpsWorks automatically associates the appropriate built-in security group with each layer (default setting). You can associate additional security groups with a layer after you create it, but you cannot delete the built-in security group.

  • False - AWS OpsWorks does not associate built-in security groups with layers. You must create appropriate EC2 security groups and associate a security group with each layer that you create. However, you can still manually associate a built-in security group with a layer on. Custom security groups are required only for those layers that need custom settings.

For more information, see Create a New Stack.

type AgentVersion:

string

param AgentVersion:

The default AWS OpsWorks agent version. You have the following options:

  • Auto-update - Set this parameter to LATEST. AWS OpsWorks automatically installs new agent versions on the stack's instances as soon as they are available.

  • Fixed version - Set this parameter to your preferred agent version. To update the agent version, you must edit the stack configuration and specify a new version. AWS OpsWorks then automatically installs that version on the stack's instances.

The default setting is LATEST. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call DescribeAgentVersions.

returns:

None