ElasticBeanstalk / Client / create_configuration_template

create_configuration_template#

ElasticBeanstalk.Client.create_configuration_template(**kwargs)#

Creates an AWS Elastic Beanstalk configuration template, associated with a specific Elastic Beanstalk application. You define application configuration settings in a configuration template. You can then use the configuration template to deploy different versions of the application with the same configuration settings.

Templates aren’t associated with any environment. The EnvironmentName response element is always null.

Related Topics

  • DescribeConfigurationOptions

  • DescribeConfigurationSettings

  • ListAvailableSolutionStacks

See also: AWS API Documentation

Request Syntax

response = client.create_configuration_template(
    ApplicationName='string',
    TemplateName='string',
    SolutionStackName='string',
    PlatformArn='string',
    SourceConfiguration={
        'ApplicationName': 'string',
        'TemplateName': 'string'
    },
    EnvironmentId='string',
    Description='string',
    OptionSettings=[
        {
            'ResourceName': 'string',
            'Namespace': 'string',
            'OptionName': 'string',
            'Value': 'string'
        },
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
Parameters:
  • ApplicationName (string) –

    [REQUIRED]

    The name of the Elastic Beanstalk application to associate with this configuration template.

  • TemplateName (string) –

    [REQUIRED]

    The name of the configuration template.

    Constraint: This name must be unique per application.

  • SolutionStackName (string) –

    The name of an Elastic Beanstalk solution stack (platform version) that this configuration uses. For example, 64bit Amazon Linux 2013.09 running Tomcat 7 Java 7. A solution stack specifies the operating system, runtime, and application server for a configuration template. It also determines the set of configuration options as well as the possible and default values. For more information, see Supported Platforms in the AWS Elastic Beanstalk Developer Guide.

    You must specify SolutionStackName if you don’t specify PlatformArn, EnvironmentId, or SourceConfiguration.

    Use the `ListAvailableSolutionStacks <https://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_ListAvailableSolutionStacks.html>`__API to obtain a list of available solution stacks.

  • PlatformArn (string) –

    The Amazon Resource Name (ARN) of the custom platform. For more information, see Custom Platforms in the AWS Elastic Beanstalk Developer Guide.

    Note

    If you specify PlatformArn, then don’t specify SolutionStackName.

  • SourceConfiguration (dict) –

    An Elastic Beanstalk configuration template to base this one on. If specified, Elastic Beanstalk uses the configuration values from the specified configuration template to create a new configuration.

    Values specified in OptionSettings override any values obtained from the SourceConfiguration.

    You must specify SourceConfiguration if you don’t specify PlatformArn, EnvironmentId, or SolutionStackName.

    Constraint: If both solution stack name and source configuration are specified, the solution stack of the source configuration template must match the specified solution stack name.

    • ApplicationName (string) –

      The name of the application associated with the configuration.

    • TemplateName (string) –

      The name of the configuration template.

  • EnvironmentId (string) – The ID of an environment whose settings you want to use to create the configuration template. You must specify EnvironmentId if you don’t specify PlatformArn, SolutionStackName, or SourceConfiguration.

  • Description (string) – An optional description for this configuration.

  • OptionSettings (list) –

    Option values for the Elastic Beanstalk configuration, such as the instance type. If specified, these values override the values obtained from the solution stack or the source configuration template. For a complete list of Elastic Beanstalk configuration options, see Option Values in the AWS Elastic Beanstalk Developer Guide.

    • (dict) –

      A specification identifying an individual configuration option along with its current value. For a list of possible namespaces and option values, see Option Values in the AWS Elastic Beanstalk Developer Guide.

      • ResourceName (string) –

        A unique resource name for the option setting. Use it for a time–based scaling configuration option.

      • Namespace (string) –

        A unique namespace that identifies the option’s associated AWS resource.

      • OptionName (string) –

        The name of the configuration option.

      • Value (string) –

        The current value for the configuration option.

  • Tags (list) –

    Specifies the tags applied to the configuration template.

    • (dict) –

      Describes a tag applied to a resource in an environment.

      • Key (string) –

        The key of the tag.

      • Value (string) –

        The value of the tag.

Return type:

dict

Returns:

Response Syntax

{
    'SolutionStackName': 'string',
    'PlatformArn': 'string',
    'ApplicationName': 'string',
    'TemplateName': 'string',
    'Description': 'string',
    'EnvironmentName': 'string',
    'DeploymentStatus': 'deployed'|'pending'|'failed',
    'DateCreated': datetime(2015, 1, 1),
    'DateUpdated': datetime(2015, 1, 1),
    'OptionSettings': [
        {
            'ResourceName': 'string',
            'Namespace': 'string',
            'OptionName': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    Describes the settings for a configuration set.

    • SolutionStackName (string) –

      The name of the solution stack this configuration set uses.

    • PlatformArn (string) –

      The ARN of the platform version.

    • ApplicationName (string) –

      The name of the application associated with this configuration set.

    • TemplateName (string) –

      If not null, the name of the configuration template for this configuration set.

    • Description (string) –

      Describes this configuration set.

    • EnvironmentName (string) –

      If not null, the name of the environment for this configuration set.

    • DeploymentStatus (string) –

      If this configuration set is associated with an environment, the DeploymentStatus parameter indicates the deployment status of this configuration set:

      • null: This configuration is not associated with a running environment.

      • pending: This is a draft configuration that is not deployed to the associated environment but is in the process of deploying.

      • deployed: This is the configuration that is currently deployed to the associated running environment.

      • failed: This is a draft configuration that failed to successfully deploy.

    • DateCreated (datetime) –

      The date (in UTC time) when this configuration set was created.

    • DateUpdated (datetime) –

      The date (in UTC time) when this configuration set was last modified.

    • OptionSettings (list) –

      A list of the configuration options and their values in this configuration set.

      • (dict) –

        A specification identifying an individual configuration option along with its current value. For a list of possible namespaces and option values, see Option Values in the AWS Elastic Beanstalk Developer Guide.

        • ResourceName (string) –

          A unique resource name for the option setting. Use it for a time–based scaling configuration option.

        • Namespace (string) –

          A unique namespace that identifies the option’s associated AWS resource.

        • OptionName (string) –

          The name of the configuration option.

        • Value (string) –

          The current value for the configuration option.

Exceptions

  • ElasticBeanstalk.Client.exceptions.InsufficientPrivilegesException

  • ElasticBeanstalk.Client.exceptions.TooManyBucketsException

  • ElasticBeanstalk.Client.exceptions.TooManyConfigurationTemplatesException

Examples

The following operation creates a configuration template named my-app-v1 from the settings applied to an environment with the id e-rpqsewtp2j:

response = client.create_configuration_template(
    ApplicationName='my-app',
    EnvironmentId='e-rpqsewtp2j',
    TemplateName='my-app-v1',
)

print(response)

Expected Output:

{
    'ApplicationName': 'my-app',
    'DateCreated': datetime(2015, 8, 12, 18, 40, 39, 2, 224, 0),
    'DateUpdated': datetime(2015, 8, 12, 18, 40, 39, 2, 224, 0),
    'SolutionStackName': '64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8',
    'TemplateName': 'my-app-v1',
    'ResponseMetadata': {
        '...': '...',
    },
}