Skip to content

Resource: awsElasticBeanstalkApplicationVersion

Provides an Elastic Beanstalk Application Version 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 a Beanstalk Application Version that can be deployed to a Beanstalk Environment.

\~> NOTE on Application Version Resource: When using the Application Version resource with multiple Elastic Beanstalk Environments it is possible that an error may be returned when attempting to delete an Application Version while it is still in use by a different environment. To work around this you can either create each environment in a separate AWS account or create your awsElasticBeanstalkApplicationVersion resources with a unique names in your Elastic Beanstalk Application. For example \-\.

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,
  "default",
  {
    description: "tf-test-desc",
    name: "tf-test-name",
  }
);
const awsS3BucketDefault = new aws.s3Bucket.S3Bucket(this, "default_1", {
  bucket: "tftest.applicationversion.bucket",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsS3BucketDefault.overrideLogicalId("default");
const awsS3ObjectDefault = new aws.s3Object.S3Object(this, "default_2", {
  bucket: awsS3BucketDefault.id,
  key: "beanstalk/go-v1.zip",
  source: "go-v1.zip",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsS3ObjectDefault.overrideLogicalId("default");
const awsElasticBeanstalkApplicationVersionDefault =
  new aws.elasticBeanstalkApplicationVersion.ElasticBeanstalkApplicationVersion(
    this,
    "default_3",
    {
      application: "tf-test-name",
      bucket: awsS3BucketDefault.id,
      description: "application version created by terraform",
      key: awsS3ObjectDefault.id,
      name: "tf-test-version-label",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsElasticBeanstalkApplicationVersionDefault.overrideLogicalId("default");

Argument Reference

The following arguments are required:

  • application - (Required) Name of the Beanstalk Application the version is associated with.
  • bucket - (Required) S3 bucket that contains the Application Version source bundle.
  • key - (Required) S3 object that is the Application Version source bundle.
  • name - (Required) Unique name for the this Application Version.

The following arguments are optional:

  • description - (Optional) Short description of the Application Version.
  • forceDelete - (Optional) On delete, force an Application Version to be deleted when it may be in use by multiple Elastic Beanstalk Environments.
  • tags - (Optional) Key-value map of tags for the Elastic Beanstalk Application Version. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

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

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