Skip to content

create_configuration_template

create_configuration_template(
    application_name: ApplicationName,
    template_name: ConfigurationTemplateName,
    *,
    config_overrides: Optional[ElasticBeanstalkClientConfig] = None,
    solution_stack_name: Optional[SolutionStackName] = None,
    platform_arn: Optional[PlatformArn] = None,
    source_configuration: Optional[SourceConfiguration] = None,
    environment_id: Optional[EnvironmentId] = None,
    description: Optional[Description] = None,
    option_settings: Optional[ConfigurationOptionSettingsList] = None,
    tags: Optional[Tags] = None,
) -> ConfigurationSettingsDescription

Creates an 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

Parameters:

  • application_name (ApplicationName) –

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

  • template_name (ConfigurationTemplateName) –

    The name of the configuration template.

    Constraint: This name must be unique per application.

  • solution_stack_name (Optional[SolutionStackName], default: None ) –

    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 Elastic Beanstalk Developer Guide.

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

    Use the ListAvailableSolutionStacks API to obtain a list of available solution stacks.

  • platform_arn (Optional[PlatformArn], default: None ) –

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

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

  • source_configuration (Optional[SourceConfiguration], default: None ) –

    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.

  • environment_id (Optional[EnvironmentId], default: None ) –

    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 (Optional[Description], default: None ) –

    An optional description for this configuration.

  • option_settings (Optional[ConfigurationOptionSettingsList], default: None ) –

    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 Elastic Beanstalk Developer Guide.

  • tags (Optional[Tags], default: None ) –

    Specifies the tags applied to the configuration template.

Raises:

Examples:

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

>>> client.create_configuration_template(application_name='my-app', template_name='my-app-v1', environment_id='e-rpqsewtp2j')
Source code in docs_src/capo_elastic_beanstalk/_services/elastic_beanstalk.py
def create_configuration_template(
    self,
    application_name: "capo_elastic_beanstalk.types.application_name.ApplicationName",
    template_name: "capo_elastic_beanstalk.types.configuration_template_name.ConfigurationTemplateName",
    *,
    config_overrides: Optional[ElasticBeanstalkClientConfig] = None,
    solution_stack_name: Optional[
        "capo_elastic_beanstalk.types.solution_stack_name.SolutionStackName"
    ] = None,
    platform_arn: Optional[
        "capo_elastic_beanstalk.types.platform_arn.PlatformArn"
    ] = None,
    source_configuration: Optional[
        "capo_elastic_beanstalk.types.source_configuration.SourceConfiguration"
    ] = None,
    environment_id: Optional[
        "capo_elastic_beanstalk.types.environment_id.EnvironmentId"
    ] = None,
    description: Optional[
        "capo_elastic_beanstalk.types.description.Description"
    ] = None,
    option_settings: Optional[
        "capo_elastic_beanstalk.types.configuration_option_settings_list.ConfigurationOptionSettingsList"
    ] = None,
    tags: Optional["capo_elastic_beanstalk.types.tags.Tags"] = None,
) -> "capo_elastic_beanstalk.types.configuration_settings_description.ConfigurationSettingsDescription":
    """<p>Creates an 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.</p> <p>Templates aren't associated with any environment. The <code>EnvironmentName</code> response element is always <code>null</code>.</p> <p>Related Topics</p> <ul> <li> <p> <a>DescribeConfigurationOptions</a> </p> </li> <li> <p> <a>DescribeConfigurationSettings</a> </p> </li> <li> <p> <a>ListAvailableSolutionStacks</a> </p> </li> </ul>

    Args:
        application_name: <p>The name of the Elastic Beanstalk application to associate with this configuration template.</p>
        template_name: <p>The name of the configuration template.</p> <p>Constraint: This name must be unique per application.</p>
        solution_stack_name: <p>The name of an Elastic Beanstalk solution stack (platform version) that this configuration uses. For example, <code>64bit Amazon Linux 2013.09 running Tomcat 7 Java 7</code>. 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 <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html">Supported Platforms</a> in the <i>Elastic Beanstalk Developer Guide</i>.</p> <p>You must specify <code>SolutionStackName</code> if you don't specify <code>PlatformArn</code>, <code>EnvironmentId</code>, or <code>SourceConfiguration</code>.</p> <p>Use the <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_ListAvailableSolutionStacks.html"> <code>ListAvailableSolutionStacks</code> </a> API to obtain a list of available solution stacks.</p>
        platform_arn: <p>The Amazon Resource Name (ARN) of the custom platform. For more information, see <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html"> Custom Platforms</a> in the <i>Elastic Beanstalk Developer Guide</i>.</p> <note> <p>If you specify <code>PlatformArn</code>, then don't specify <code>SolutionStackName</code>.</p> </note>
        source_configuration: <p>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.</p> <p>Values specified in <code>OptionSettings</code> override any values obtained from the <code>SourceConfiguration</code>.</p> <p>You must specify <code>SourceConfiguration</code> if you don't specify <code>PlatformArn</code>, <code>EnvironmentId</code>, or <code>SolutionStackName</code>.</p> <p>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.</p>
        environment_id: <p>The ID of an environment whose settings you want to use to create the configuration template. You must specify <code>EnvironmentId</code> if you don't specify <code>PlatformArn</code>, <code>SolutionStackName</code>, or <code>SourceConfiguration</code>.</p>
        description: <p>An optional description for this configuration.</p>
        option_settings: <p>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 <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html">Option Values</a> in the <i>Elastic Beanstalk Developer Guide</i>.</p>
        tags: <p>Specifies the tags applied to the configuration template.</p>

    Raises:
        capo_elastic_beanstalk.errors.insufficient_privileges_exception.InsufficientPrivilegesException: <p>The specified account does not have sufficient privileges for one or more Amazon Web Services services.</p>
        capo_elastic_beanstalk.errors.too_many_buckets_exception.TooManyBucketsException: <p>The specified account has reached its limit of Amazon S3 buckets.</p>
        capo_elastic_beanstalk.errors.too_many_configuration_templates_exception.TooManyConfigurationTemplatesException: <p>The specified account has reached its limit of configuration templates.</p>
        capo_elastic_beanstalk.errors.UnknownServiceError: The service returned an error code this client does not model.

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

        >>> client.create_configuration_template(application_name='my-app', template_name='my-app-v1', environment_id='e-rpqsewtp2j')
    """

    def _handler(
        req: "OperationRequest[capo_elastic_beanstalk.types.create_configuration_template_message.CreateConfigurationTemplateMessage]",
    ) -> OperationResponse[
        "capo_elastic_beanstalk.types.configuration_settings_description.ConfigurationSettingsDescription"
    ]:
        import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.create_configuration_template

        output, http_response = (
            capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.create_configuration_template.create_configuration_template(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateConfigurationTemplate")
    )
    input_: capo_elastic_beanstalk.types.create_configuration_template_message.CreateConfigurationTemplateMessage = {
        "application_name": application_name,
        "template_name": template_name,
    }
    if solution_stack_name is not None:
        input_["solution_stack_name"] = solution_stack_name
    if platform_arn is not None:
        input_["platform_arn"] = platform_arn
    if source_configuration is not None:
        input_["source_configuration"] = source_configuration
    if environment_id is not None:
        input_["environment_id"] = environment_id
    if description is not None:
        input_["description"] = description
    if option_settings is not None:
        input_["option_settings"] = option_settings
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output