Skip to content

Resource: awsElasticBeanstalkApplication

Provides an Elastic Beanstalk Application Resource. Elastic Beanstalk allows you to deploy and manage applications in the AWS cloud without worrying about the infrastructure that runs those applications.

This resource creates an application that has one configuration template named default, and no application versions

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.elasticBeanstalkApplication.ElasticBeanstalkApplication(
  this,
  "tftest",
  {
    appversionLifecycle: {
      deleteSourceFromS3: true,
      maxCount: 128,
      serviceRole: "${aws_iam_role.beanstalk_service.arn}",
    },
    description: "tf-test-desc",
    name: "tf-test-name",
  }
);

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the application, must be unique within your account
  • description - (Optional) Short description of the application
  • tags - (Optional) Key-value map of tags for the Elastic Beanstalk Application. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Application version lifecycle (appversionLifecycle) supports the following settings. Only one of either maxCount or maxAgeInDays can be provided:

  • serviceRole - (Required) The ARN of an IAM service role under which the application version is deleted. Elastic Beanstalk must have permission to assume this role.
  • maxCount - (Optional) The maximum number of application versions to retain ('max_age_in_days' and 'max_count' cannot be enabled simultaneously.).
  • maxAgeInDays - (Optional) The number of days to retain an application version ('max_age_in_days' and 'max_count' cannot be enabled simultaneously.).
  • deleteSourceFromS3 - (Optional) Set to true to delete a version's source bundle from S3 when the application version is deleted.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - The ARN assigned by AWS for this Elastic Beanstalk Application.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

Elastic Beanstalk Applications can be imported using the name, e.g.,

$ terraform import aws_elastic_beanstalk_application.tf_test tf-test-name