actions-marketplace-validations/Deploy Docker to AWS (EC2)

Deploy a Docker app to an AWS Virtual Machine (EC2) with Docker Compose

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Maintainedlast commit Jan 6, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: actions-marketplace-validations/bitovi_github-actions-deploy-docker-to-ec2@fa96354cf831d960451f41b8bc0e834e6e4b64b0 # no releases — HEAD as of 2026-07-10

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
aws_access_key_idAWS access key IDno
aws_secret_access_keyAWS secret access keyno
aws_session_tokenAWS session tokenno
aws_default_regionAWS default regionnous-east-1
aws_resource_identifierSet to override the AWS resource identifier for the deployment. Defaults to `${org}-{repo}-{branch}`. Use with destroy to destroy specific resources.no
aws_additional_tagsA JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}`no
checkoutSpecifies if this action should checkout the codenotrue
bitops_code_onlyWill run only the generation phase of BitOps, where the Terraform and Ansible code is built.no
bitops_code_storeStore BitOps code as a GitHub artifactno
tf_stack_destroySet to "true" to Destroy the stack through Terraform.no
tf_state_file_nameChange this to be anything you want to. Carefull to be consistent here. A missing file could trigger recreation, or stepping over destruction of non-defined objects.no
tf_state_file_name_appendAppend a string to the tf-state-file. Setting this to `unique` will generate `tf-state-aws-unique`. Can co-exist with the tf_state_file_name variable. no
tf_state_bucketAWS S3 bucket to use for Terraform state. Defaults to `${org}-${repo}-{branch}-tf-state`no
tf_state_bucket_destroyForce purge and deletion of S3 bucket defined. Only evaluated when `tf_stack_destroy` is also true, so it is safe to leave this enabled when standing up your stack.no
tf_targetsA list of targets to create before the full stack creation.no
ansible_skipSkip Ansible execution after Terraform excecution.no
ansible_ssh_to_private_ipMake Ansible connect to the private IP of the instance. Only usefull if using a hosted runner in the same network.no
ansible_start_docker_timeoutAmmount of time in seconds it takes Ansible to mark as failed the startup of docker. Defaults to `300`no
env_aws_secretSecret name to pull env variables from AWS Secret Manager, could be a comma separated list, read in order. Expected JSON content.no
env_repoFile containing environment variables to be used with the appno
env_ghsGitHub Secret Name containing `.env` file style to be used with the app.no
env_ghvGitHub Variable Name containing `.env` file style to be used with the app.no
aws_ec2_instance_createDefine if an EC2 instance should be creatednotrue
aws_ec2_ami_filterAWS AMI Filter string. Will be used to lookup for lates image based on the string. Defaults to `ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*`.no
aws_ec2_ami_ownerOwner of AWS AMI image. This ensures the provider is the one we are looking for. Defaults to `099720109477`, Canonical (Ubuntu).no
aws_ec2_ami_idAWS AMI ID. Will default to lookup for latest image of the `aws_ec2_ami_filter` string. This will override `aws_ec2_ami_filter` lookup.no
aws_ec2_ami_updateSet this to true if you want to recreate the EC2 instance if there is a newer version of the AMI.no
aws_ec2_iam_instance_profileThe AWS IAM instance profile to use for the EC2 instanceno
aws_ec2_instance_typeThe AWS Instance typeno
aws_ec2_instance_root_vol_sizeDefine the volume size (in GiB) for the root volume on the AWS Instance.no
aws_ec2_instance_root_vol_preserveSet this to true to avoid deletion of root volume on termination. Defaults to false.no
aws_ec2_security_group_nameThe name of the EC2 security groupno
aws_ec2_create_keypair_smGenerates and manages a secret manager entry that contains the public and private keys created for the ec2 instance.no
aws_ec2_instance_public_ipAdd a public IP to the instance or not. (Not an Elastic IP)notrue
aws_ec2_port_listList of ports to be enabled as an ingress rule in the EC2 SG, in a [xx,yy] format - Not the ELBno
aws_ec2_user_data_fileRelative path in the repo for a user provided script to be executed with Terraform EC2 Instance creation.no
aws_ec2_user_data_replace_on_changeIf user_data file changes, instance will stop and start. Hence public IP will change. Defaults to true.no
aws_ec2_additional_tagsA JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}`no
aws_vpc_createDefine if a VPC should be createdno
aws_vpc_nameSet a specific name for the VPCno
aws_vpc_cidr_blockDefine Base CIDR block which is divided into subnet CIDR blocks. Defaults to 10.0.0.0/16.no
aws_vpc_public_subnetsComma separated list of public subnets. Defaults to 10.10.110.0/24no
aws_vpc_private_subnetsComma separated list of private subnets. If none, none will be created.no
aws_vpc_availability_zonesComma separated list of availability zones. Defaults to `aws_default_region.no
aws_vpc_idAWS VPC ID. Accepts `vpc-###` values.no
aws_vpc_subnet_idSpecify a Subnet to be used with the instance. If none provided, will pick one.no
aws_vpc_enable_nat_gatewayEnables NAT gatewayno
aws_vpc_single_nat_gatewayCreates only one NAT gatewayno
aws_vpc_external_nat_ip_idsComma separated list of IP IDS to reuse in the NAT gatewaysno
aws_vpc_additional_tagsA JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}`no
aws_r53_enableEnables the usage of Route53 to manage DNS records.no
aws_r53_domain_nameDefine the root domain name for the application. e.g. app.comno
aws_r53_sub_domain_nameDefine the sub-domain part of the URL. Defaults to `${org}-${repo}-{branch}`
aws_r53_root_domain_deployDeploy to root domain. Will generate two DNS recrods, one for root, another for wwwno
aws_r53_enable_certMakes the application use a certificate by enabling a certificate lookup.notrue
aws_r53_cert_arnDefine the certificate ARN to use for the applicationno
aws_r53_create_root_certGenerates and manage the root cert for the applicationno
aws_r53_create_sub_certGenerates and manage the sub-domain certificate for the applicationno
aws_r53_additional_tagsA JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}`no
aws_elb_createCreate a load balancer and map ports to the EC2 instance.notrue
aws_elb_security_group_nameThe name of the ELB security groupno
aws_elb_app_portPort to expose for the appno3000
aws_elb_app_protocolProtocol to enable. Could be HTTP, HTTPS, TCP or SSL. Defaults to TCP.no
aws_elb_listen_portLoad balancer listening port. Defaults to 80 if NO FQDN provided, 443 if FQDN providedno
aws_elb_listen_protocolProtocol to enable. Could be HTTP, HTTPS, TCP or SSL. Defaults to TCP if NO FQDN provided, SSL if FQDN providedno
aws_elb_healthcheckLoad balancer health check string. Defaults to TCP:22no
aws_elb_access_log_bucket_nameS3 bucket name to store the ELB access logs.no
aws_elb_access_log_expireDelete the access logs after this amount of days. Defaults to 90.no
aws_elb_additional_tagsA JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}`no
aws_alb_createGlobal toggle for ALB creationno
aws_alb_security_group_nameName of the security group to use for ALBno
aws_alb_app_portComma-separated list of application ports for ALB target groupno
aws_alb_app_protocolComma-separated list of protocols for ALB target group (HTTP/HTTPS)no
aws_alb_listen_portComma-separated list of listener ports for ALBno
aws_alb_listen_protocolComma-separated list of listener protocols for ALB (HTTP/HTTPS)no
aws_alb_redirect_enableEnable HTTP to HTTPS redirection on ALBno
aws_alb_www_to_apex_redirectEnable www to apex domain redirection on ALBno
aws_alb_healthcheck_pathHealth check path for ALB target groupno
aws_alb_healthcheck_protocolHealth check protocol for ALB target groupno
aws_alb_ssl_policySSL policy for HTTPS listenersno
aws_alb_access_log_enabledEnable ALB access logsno
aws_alb_access_log_bucket_nameS3 bucket name to store the ALB access logsno
aws_alb_access_log_expireDelete the access logs after this amount of daysno
aws_alb_additional_tagsA JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}`no
aws_waf_enableEnable WAF for load balancer.no
aws_waf_logging_enableEnable WAF logging to CloudWatch.no
aws_waf_log_retention_daysCloudWatch log retention period for WAF logs.no
aws_waf_rule_rate_limitRate limit for WAF rules.no
aws_waf_rule_rate_limit_priorityPriority for rate limit rule.no
aws_waf_rule_managed_rulesEnable common managed rule groups to use.no
aws_waf_rule_managed_rules_priorityPriority for managed rules group.no
aws_waf_rule_managed_bad_inputsEnable managed rule for bad inputs.no
aws_waf_rule_managed_bad_inputs_priorityPriority for bad inputs managed rule.no
aws_waf_rule_ip_reputationEnable managed rule for IP reputation.no
aws_waf_rule_ip_reputation_priorityPriority for IP reputation managed rule.no
aws_waf_rule_anonymous_ipEnable managed rule for anonymous IP.no
aws_waf_rule_anonymous_ip_priorityPriority for anonymous IP managed rule.no
aws_waf_rule_bot_controlEnable managed rule for bot control (costs extra).no
aws_waf_rule_bot_control_priorityPriority for bot control managed rule.no
aws_waf_rule_geo_block_countriesComma separated list of countries to block.no
aws_waf_rule_geo_block_countries_priorityPriority for geo block countries managed rule.no
aws_waf_rule_geo_allow_only_countriesComma separated list of countries to allow.no
aws_waf_rule_geo_allow_only_countries_priorityPriority for geo allow only countries managed rule.no
aws_waf_rule_sqliEnable managed rule for SQL injection.no
aws_waf_rule_sqli_priorityPriority for SQL injection managed rule.no
aws_waf_rule_linuxEnable managed rule for Linux.no
aws_waf_rule_linux_priorityPriority for Linux managed rule.no
aws_waf_rule_unixEnable managed rule for Unix.no
aws_waf_rule_unix_priorityPriority for Unix managed rule.no
aws_waf_rule_admin_protectionEnable managed rule for admin protection.no
aws_waf_rule_admin_protection_priorityPriority for admin protection managed rule.no
aws_waf_rule_user_arnARN of the user rule.no
aws_waf_rule_user_arn_priorityPriority for user defined rule.no
aws_waf_additional_tagsA JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}`no
docker_installDefine if docker should be installed. After this, docker-compose up will be excecuted.notrue
docker_remove_orphansToggle --remove-orphans flag. Defaults to false.no
docker_full_cleanupSet to true to run docker-compose down and docker system prune --all --force --volumes after.no
docker_repo_app_directoryRelative path for the directory of the app (i.e. where `Dockerfile` and `docker-compose.yaml` files are located). This is the directory that is copied to the compute instance (EC2). Default is the root of the repo. Add a .gha-ignore file with a list of files to be exluded. no
docker_repo_app_directory_cleanupWill generate a timestamped compressed file and delete the app repo directory.no
docker_backup_retentionNumber of old backups to retain. Default is unlimited.no
docker_efs_mount_targetDirectory path within docker env to mount directory to, default is `/data`no
docker_cloudwatch_enableToggle cloudwatch creation for Docker containers.no
docker_cloudwatch_lg_nameLog group name. Will default to aws_identifier if none.no
docker_cloudwatch_skip_destroyToggle deletion or not when destroying the stack.no
docker_cloudwatch_retention_daysNumber of days to retain logs. 0 to never expire.no
aws_efs_createToggle to indicate whether to create and EFS and mount it to the ec2 as a part of the provisioning. Note: The EFS will be managed by the stack and will be destroyed along with the stack.no
aws_efs_fs_idID of existing EFSno
aws_efs_create_mount_targetToggle to indicate whether we should create a mount target for the EFS volume. Accepts incoming fs_id with no mount targets too.no
aws_efs_create_haToggle to indicate whether the EFS resource should be highly available (mount points in all available zones within region).no
aws_efs_vol_encryptedToggle encryption of the EFS volume.no
aws_efs_kms_key_idThe ARN for the KMS encryption key. Default key will be used if none defined.no
aws_efs_performance_modeToggle perfomance mode. Options are: generalPurpose or maxIO.no
aws_efs_throughput_modeThroughput mode for the file system. Defaults to bursting. Valid values: bursting, provisioned, or elastic. When using provisioned, also set provisioned_throughput_in_mibps.no
aws_efs_throughput_speedThe throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with throughput_mode set to provisioned.no
aws_efs_security_group_nameThe name of the EFS security group. Defaults to SG for aws_resource_identifier - EFS.no
aws_efs_allowed_security_groupsComma separated list of security groups to be added to the EFS SG.no
aws_efs_ingress_allow_allAllow incoming traffic from 0.0.0.0/0.no
aws_efs_create_replicaToggle to indiciate whether a read-only replica should be created for the EFS primary file systemno
aws_efs_replication_destinationAWS Region to target for replicationno
aws_efs_enable_backup_policyToggle to indiciate whether the EFS should have a backup policy, default is `false`no
aws_efs_transition_to_inactivehttps://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/efs_file_system#transition_to_iano
aws_efs_mount_targetDirectory path in efs to mount tono
aws_efs_ec2_mount_pointDirectory path in application env to mount directoryno
aws_efs_additional_tagsA list of strings that will be added to created resourcesno
aws_rds_db_enableSet to true to enable an RDS DB.no
aws_rds_db_proxySet to true to add a RDS DB Proxyno
aws_rds_db_identifierDatabase identifier that will appear in the AWS Console. Defaults to aws_resource_identifier if none set.no
aws_rds_db_nameThe name of the database to create when the DB instance is created.no
aws_rds_db_userUsername for the db. Defaults to dbuser.no
aws_rds_db_engineWhich Database engine to use. Default is postgresno
aws_rds_db_engine_versionWhich Database engine version to use.no
aws_rds_db_ca_cert_identifierCertificate to use with the database. Defaults to rds-ca-ecc384-g1no
aws_rds_db_security_group_nameThe name of the database security group. Defaults to SG for aws_resource_identifier - RDS.no
aws_rds_db_allowed_security_groupsComma separated list of security groups to add to the DB SGno
aws_rds_db_ingress_allow_allAllow incoming traffic from 0.0.0.0/0.no
aws_rds_db_publicly_accessibleAllow the database to be publicly accessible.no
aws_rds_db_port Port where the DB listens to.no
aws_rds_db_subnetsSpecify which subnets to use as a list of strings. no
aws_rds_db_allocated_storageStorage size. Defaults to 10.no
aws_rds_db_max_allocated_storageMax storage size. Defaults to 0 to disable auto-scaling.no
aws_rds_db_instance_classDB instance server type. Defaults to db.t3.micro.no
aws_rds_db_storage_encryptedToogle storage encryption. Defatuls to false.no
aws_rds_db_storage_typeStorage type. Like gp2 / gp3. Defaults to gp2.no
aws_rds_db_kms_key_idThe ARN for the KMS encryption key.no
aws_rds_db_final_snapshotGenerates a snapshot of the database before deletion.no
aws_rds_db_restore_snapshot_identifierName of the snapshot to restore the database from.no
aws_rds_db_cloudwatch_logs_exportsSet of log types to enable for exporting to CloudWatch logs.no
aws_rds_db_multi_azSpecifies if the RDS instance is multi-AZno
aws_rds_db_maintenance_windowThe window to perform maintenance in. Eg: Mon:00:00-Mon:03:00 no
aws_rds_db_apply_immediatelySpecifies whether any database modifications are applied immediately, or during the next maintenance windowno
aws_rds_db_additional_tagsA JSON object of additional tags that will be included on created resources. Example: `{"key1": "value1", "key2": "value2"}`no
aws_db_proxy_nameDB Proxy nameno
aws_db_proxy_client_password_auth_typeAuth type to use, will use the following, depending on DB the family. MYSQL_NATIVE_PASSWORD, POSTGRES_SCRAM_SHA_256, and SQL_SERVER_AUTHENTICATIONno
aws_db_proxy_tlsToogle TLS enforcement for connectionno
aws_db_proxy_security_group_nameName for the proxy security group. Default to aws_resource_identifier if none.no
aws_db_proxy_database_security_group_allowWill add an incoming rule from every security group associated with the DBno
aws_db_proxy_allowed_security_groupComma separated list of SG Ids to add.no
aws_db_proxy_allow_all_incomingAllow all incoming traffic to the DB Proxy. Mind that the proxy is only available from the internal network except manually exposed.no
aws_db_proxy_cloudwatch_enableToggle Cloudwatch logs. Will be stored in /aws/rds/proxy/rds_proxy.nameno
aws_db_proxy_cloudwatch_retention_daysNumber of days to retain logsno
aws_db_proxy_additional_tagsA list of strings that will be added to created resourcesno
gh_deployment_input_terraformFolder to store Terraform files to be included during Terraform execution.no
gh_deployment_input_ansibleFolder where a whole Ansible structure is expected. If missing bitops.config.yaml a default will be generated.no
gh_deployment_input_ansible_playbookMain playbook to be looked for.noplaybook.yml
gh_deployment_input_ansible_extra_vars_fileRelative path to file from project root to Ansible vars file to be applied. no
gh_deployment_action_input_ansible_extra_vars_fileRelative path to file from project root to Ansible vars file to be applied into the Action Ansible execution. no
aws_ami_idno
repo_envno
dot_envno
ghv_envno
aws_secret_envno
app_directoryno
app_directory_cleanupno
app_portno
lb_portno
lb_healthcheckno
ec2_instance_profileno
ec2_instance_typeno
ec2_volume_sizeno
aws_create_efsno
aws_create_ha_efsno
aws_create_efs_replicano
aws_enable_efs_backup_policyno
aws_replication_configuration_destinationno
aws_mount_efs_idno
aws_mount_efs_security_group_idno
stack_destroyno
domain_nameno
sub_domainno
root_domainno
cert_arnno
create_root_certno
create_sub_certno
no_certno
targetsno
additional_tagsno
create_keypair_sm_entryno
aws_enable_postgresno
aws_postgres_engineno
aws_postgres_engine_versionno
aws_postgres_instance_classno
aws_postgres_subnetsno
aws_postgres_database_nameno
aws_postgres_database_portno
aws_postgres_database_final_snapshotno
application_mount_targetno
data_mount_targetno
efs_mount_targetno
namedescription
aws_vpc_idThe selected VPC ID used.
vm_urlThe URL of the generated app
instance_endpointThe URL of the generated ec2 instance
ec2_sg_idSG ID for the EC2 instance
aws_efs_fs_idEFS FS ID
aws_efs_replica_fs_idEFS FS Replica ID
aws_efs_sg_idEFS FS SG ID
db_endpointRDS Endpoint
db_secret_details_nameAWS Secret name containing db credentials
db_sg_idSG ID for the RDS instance
db_proxy_rds_endpointDatabase proxy endpoint
db_proxy_secret_name_rdsAWS Secret name containing proxy credentials
db_proxy_sg_id_rdsSG ID for the RDS Proxy instance