CreateConfigurationTemplateCommand

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

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ElasticBeanstalkClient, CreateConfigurationTemplateCommand } from "@aws-sdk/client-elastic-beanstalk"; // ES Modules import
// const { ElasticBeanstalkClient, CreateConfigurationTemplateCommand } = require("@aws-sdk/client-elastic-beanstalk"); // CommonJS import
const client = new ElasticBeanstalkClient(config);
const input = { // CreateConfigurationTemplateMessage
  ApplicationName: "STRING_VALUE", // required
  TemplateName: "STRING_VALUE", // required
  SolutionStackName: "STRING_VALUE",
  PlatformArn: "STRING_VALUE",
  SourceConfiguration: { // SourceConfiguration
    ApplicationName: "STRING_VALUE",
    TemplateName: "STRING_VALUE",
  },
  EnvironmentId: "STRING_VALUE",
  Description: "STRING_VALUE",
  OptionSettings: [ // ConfigurationOptionSettingsList
    { // ConfigurationOptionSetting
      ResourceName: "STRING_VALUE",
      Namespace: "STRING_VALUE",
      OptionName: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
  Tags: [ // Tags
    { // Tag
      Key: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
};
const command = new CreateConfigurationTemplateCommand(input);
const response = await client.send(command);
// { // ConfigurationSettingsDescription
//   SolutionStackName: "STRING_VALUE",
//   PlatformArn: "STRING_VALUE",
//   ApplicationName: "STRING_VALUE",
//   TemplateName: "STRING_VALUE",
//   Description: "STRING_VALUE",
//   EnvironmentName: "STRING_VALUE",
//   DeploymentStatus: "deployed" || "pending" || "failed",
//   DateCreated: new Date("TIMESTAMP"),
//   DateUpdated: new Date("TIMESTAMP"),
//   OptionSettings: [ // ConfigurationOptionSettingsList
//     { // ConfigurationOptionSetting
//       ResourceName: "STRING_VALUE",
//       Namespace: "STRING_VALUE",
//       OptionName: "STRING_VALUE",
//       Value: "STRING_VALUE",
//     },
//   ],
// };

Example Usage

 Loading code editor

CreateConfigurationTemplateCommand Input

Parameter
Type
Description
ApplicationName
Required
string | undefined

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

TemplateName
Required
string | undefined

The name of the configuration template.

Constraint: This name must be unique per application.

Description
string | undefined

An optional description for this configuration.

EnvironmentId
string | undefined

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.

OptionSettings
ConfigurationOptionSetting[] | undefined

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.

PlatformArn
string | undefined

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

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

SolutionStackName
string | undefined

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   API to obtain a list of available solution stacks.

SourceConfiguration
SourceConfiguration | undefined

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.

Tags
Tag[] | undefined

Specifies the tags applied to the configuration template.

CreateConfigurationTemplateCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
ApplicationName
string | undefined

The name of the application associated with this configuration set.

DateCreated
Date | undefined

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

DateUpdated
Date | undefined

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

DeploymentStatus
ConfigurationDeploymentStatus | undefined

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.

Description
string | undefined

Describes this configuration set.

EnvironmentName
string | undefined

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

OptionSettings
ConfigurationOptionSetting[] | undefined

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

PlatformArn
string | undefined

The ARN of the platform version.

SolutionStackName
string | undefined

The name of the solution stack this configuration set uses.

TemplateName
string | undefined

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

Throws

Name
Fault
Details
InsufficientPrivilegesException
client

The specified account does not have sufficient privileges for one or more AWS services.

TooManyBucketsException
client

The specified account has reached its limit of Amazon S3 buckets.

TooManyConfigurationTemplatesException
client

The specified account has reached its limit of configuration templates.

ElasticBeanstalkServiceException
Base exception class for all service exceptions from ElasticBeanstalk service.