Skip to content

Commit bb4d9bb

Browse files
authored
Commons upgrade (#149)
* EFS bump initial commit * Last commit before tagged release of commons * Bumping to latest commons * Update action.yaml * Small ouutput fix * Small tweaks. Testing new output. * Upgrade checkout version * Adding outputs to README * Tweaks * bump-action-version * Added missing RDS inputs
1 parent 3286c34 commit bb4d9bb

File tree

2 files changed

+188
-37
lines changed

2 files changed

+188
-37
lines changed

README.md

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ jobs:
177177
1. [DB Proxy](#db-proxy-inputs)
178178
1. [GitHub Deployment repo inputs](#github-deployment-repo-inputs)
179179

180+
### Outputs
181+
1. [Action Outputs](#action-outputs)
182+
180183
The following inputs can be used as `step.with` keys
181184
<br/>
182185
<br/>
@@ -254,6 +257,9 @@ The following inputs can be used as `step.with` keys
254257
| `aws_vpc_availability_zones` | String | Comma separated list of availability zones. Defaults to `aws_default_region+<random>` value. If a list is defined, the first zone will be the one used for the EC2 instance. |
255258
| `aws_vpc_id` | String | **Existing** AWS VPC ID to use. Accepts `vpc-###` values. |
256259
| `aws_vpc_subnet_id` | String | **Existing** AWS VPC Subnet ID. If none provided, will pick one. (Ideal when there's only one). |
260+
| `aws_vpc_enable_nat_gateway` | Boolean | Adds a NAT gateway for each public subnet. Defaults to `false`. |
261+
| `aws_vpc_single_nat_gateway` | Boolean | Toggles only one NAT gateway for all of the public subnets. Defaults to `false`. |
262+
| `aws_vpc_external_nat_ip_ids` | String | **Existing** comma separated list of IP IDs if reusing. (ElasticIPs). |
257263
| `aws_vpc_additional_tags` | JSON | Add additional tags to the terraform [default tags](https://www.hashicorp.com/blog/default-tags-in-the-terraform-aws-provider), any tags put here will be added to vpc provisioned resources.|
258264
<hr/>
259265
<br/>
@@ -283,6 +289,8 @@ The following inputs can be used as `step.with` keys
283289
| `aws_elb_listen_port` | String | Load balancer listening port. Default is `80` if NO FQDN provided, `443` if FQDN provided. Accepts comma separated values. |
284290
| `aws_elb_listen_protocol` | String | Protocol to enable. Could be HTTP, HTTPS, TCP or SSL. Defaults to `TCP` if NO FQDN provided, `SSL` if FQDN provided. |
285291
| `aws_elb_healthcheck` | String | Load balancer health check string. Default is `TCP:22`. |
292+
| `aws_elb_access_log_bucket_name` | String | S3 bucket name to store the ELB access logs. Defaults to `${aws_resource_identifier}-logs` (or `-lg `depending of length). **Bucket will be deleted if stack is destroyed.** |
293+
| `aws_elb_access_log_expire` | String | Delete the access logs after this amount of days. Defaults to `90`. Set to `0` in order to disable this policy. |
286294
| `aws_elb_additional_tags` | JSON | Add additional tags to the terraform [default tags](https://www.hashicorp.com/blog/default-tags-in-the-terraform-aws-provider), any tags put here will be added to elb provisioned resources.|
287295
<hr/>
288296
<br/>
@@ -307,16 +315,22 @@ The following inputs can be used as `step.with` keys
307315
#### **EFS Inputs**
308316
| Name | Type | Description |
309317
|------------------|---------|------------------------------------|
310-
| `aws_efs_create` | Boolean | Toggle to indicate whether to create an EFS and mount it to the EC2 instance as a part of the provisioning. Note: The stack will manage the EFS and will be destroyed along with the stack. |
311-
| `aws_efs_create_ha` | Boolean | Toggle to indicate whether the EFS resource should be highly available (target mounts in all available zones within a region). |
318+
| `aws_efs_create` | Boolean | Toggle to indicate whether to create an EFS volume and mount it to the EC2 instance as a part of the provisioning. Note: The stack will manage the EFS and will be destroyed along with the stack. |
312319
| `aws_efs_fs_id` | String | ID of existing EFS volume if you wish to use an existing one. |
313-
| `aws_efs_vpc_id` | String | ID of the VPC for the EFS mount target. If `aws_efs_create_ha` is set to `true`, will create one mount target per subnet available in the VPC. If not, will create one in an automated selected region. |
314-
| `aws_efs_subnet_ids` | String | ID (or ID's) of the subnet for the EFS mount target. (Comma separated string.) |
320+
| `aws_efs_create_mount_target` | String | Toggle to indicate whether we should create a mount target for the EFS volume or not. Defaults to `true`.|
321+
| `aws_efs_create_ha` | Boolean | Toggle to indicate whether the EFS resource should be highly available (mount points in all available zones within region). |
322+
| `aws_efs_vol_encrypted` | String | Toggle encryption of the EFS volume. Defaults to `true`.|
323+
| `aws_efs_kms_key_id` | String | The ARN for the KMS encryption key. Will use default if none defined. |
324+
| `aws_efs_performance_mode` | String | Toggle perfomance mode. Options are: `generalPurpose` or `maxIO`.|
325+
| `aws_efs_throughput_mode` | String | Throughput mode for the file system. Defaults to `bursting`. Valid values: `bursting`, `provisioned`, or `elastic`. When using provisioned, also set `aws_efs_throughput_speed`. |
326+
| `aws_efs_throughput_speed` | String | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with throughput_mode set to provisioned. |
315327
| `aws_efs_security_group_name` | String | The name of the EFS security group. Defaults to `SG for ${aws_resource_identifier} - EFS`. |
328+
| `aws_efs_allowed_security_groups` | String | Extra names of the security grou-ps to access the EFS volume. Accepts comma separated list of. |
329+
| `aws_efs_ingress_allow_all` | Boolean | Allow access from 0.0.0.0/0 in the same VPC. Defaults to `true`. |
316330
| `aws_efs_create_replica` | Boolean | Toggle whether a read-only replica should be created for the EFS primary file system. |
317331
| `aws_efs_replication_destination` | String | AWS Region to target for replication. |
318332
| `aws_efs_enable_backup_policy` | Boolean | Toggle whether the EFS should have a backup policy. |
319-
| `aws_efs_transition_to_inactive` | String | Indicates how long it takes to transition files to the IA storage class. |
333+
| `aws_efs_transition_to_inactive` | String | Indicates how long it takes to transition files to the IA storage class. Defaults to `AFTER_30_DAYS`. |
320334
| `aws_efs_mount_target` | String | Directory path in efs to mount directory to. Default is `/`. |
321335
| `aws_efs_ec2_mount_point` | String | The `aws_efs_ec2_mount_point` input represents the folder path within the EC2 instance to the data directory. Default is `/user/ubuntu/<application_repo>/data`. Additionally, this value is loaded into the docker-compose `.env` file as `HOST_DIR`. |
322336
| `aws_efs_additional_tags` | JSON | Add additional tags to the terraform [default tags](https://www.hashicorp.com/blog/default-tags-in-the-terraform-aws-provider), any tags put here will be added to efs provisioned resources.|
@@ -342,10 +356,16 @@ The following inputs can be used as `step.with` keys
342356
| `aws_rds_db_subnets`| String | Specify which subnets to use as a list of strings. Example: `i-1234,i-5678,i-9101`. |
343357
| `aws_rds_db_allocated_storage`| String | Storage size. Defaults to `10`. |
344358
| `aws_rds_db_max_allocated_storage`| String | Max storage size. Defaults to `0` to disable auto-scaling. |
359+
| `aws_rds_db_storage_encrypted` | Boolean | Toogle storage encryption. Defatuls to false. |
360+
| `aws_rds_db_storage_type` | String | Storage type. Like gp2 / gp3. Defaults to gp2. |
361+
| `aws_rds_db_kms_key_id` | String | The ARN for the KMS encryption key. |
345362
| `aws_rds_db_instance_class`| String | DB instance server type. Defaults to `db.t3.micro`. See [this list](https://aws.amazon.com/rds/instance-types/). |
346363
| `aws_rds_db_final_snapshot` | String | If final snapshot is wanted, add a snapshot name. Leave emtpy if not. |
347364
| `aws_rds_db_restore_snapshot_identifier` | String | Name of the snapshot to restore the databse from. |
348365
| `aws_rds_db_cloudwatch_logs_exports`| String | Set of log types to enable for exporting to CloudWatch logs. Defaults to `postgresql`. Options are MySQL and MariaDB: `audit,error,general,slowquery`. PostgreSQL: `postgresql,upgrade`. MSSQL: `agent,error`. Oracle: `alert,audit,listener,trace`. |
366+
| `aws_rds_db_multi_az` | Boolean| Specifies if the RDS instance is multi-AZ. Defaults to `false`. |
367+
| `aws_rds_db_maintenance_window` | String | The window to perform maintenance in. Eg: `Mon:00:00-Mon:03:00` |
368+
| `aws_rds_db_apply_immediately` | Boolean | Specifies whether any database modifications are applied immediately, or during the next maintenance window. Defaults to `false`.|
349369
| `aws_rds_db_additional_tags` | JSON | Add additional tags to the terraform [default tags](https://www.hashicorp.com/blog/default-tags-in-the-terraform-aws-provider), any tags put here will be added to RDS provisioned resources.|
350370
<hr/>
351371
<br/>
@@ -377,6 +397,29 @@ The following inputs can be used as `step.with` keys
377397
<hr/>
378398
<br/>
379399

400+
#### **Action Outputs**
401+
| Name | Description |
402+
|------------------|------------------------------------|
403+
| **VPC** |
404+
| `aws_vpc_id` | The selected VPC ID used. |
405+
| **EC2** |
406+
| `vm_url` | The URL of the generated app. |
407+
| `instance_endpoint` | The URL of the generated ec2 instance. |
408+
| `ec2_sg_id` | SG ID for the EC2 instance. |
409+
| **EFS** |
410+
| `aws_efs_fs_id` | AWS EFS FS ID of the volume. |
411+
| `aws_efs_replica_fs_id` | AWS EFS FS ID of the replica volume. |
412+
| `aws_efs_sg_id` | SG ID for the EFS Volume. |
413+
| **RDS** |
414+
| `db_endpoint` | RDS Endpoint. |
415+
| `db_secret_details_name` | AWS Secret name containing db credentials. |
416+
| `db_sg_id` | SG ID for the RDS instance. |
417+
| `db_proxy_rds_endpoint` | Database proxy endpoint. |
418+
| `db_proxy_secret_name_rds` | AWS Secret name containing proxy credentials. |
419+
| `db_proxy_sg_id_rds` | SG ID for the RDS Proxy instance. |
420+
<hr/>
421+
<br/>
422+
380423
## Note about resource identifiers
381424

382425
Most resources will contain the tag `${GITHUB_ORG_NAME}-${GITHUB_REPO_NAME}-${GITHUB_BRANCH_NAME}`, some of them, even the resource name after.
@@ -416,7 +459,9 @@ Option 1, you have access to the `aws_efs_create` attribute which will create a
416459
> :warning: Be very careful here! The **EFS is fully managed by Terraform**. Therefor **it will be destroyed upon stack destruction**.
417460

418461
### 2. Mount EFS
419-
Option 2, you have access to the `aws_efs_fs_id` attributes, which will mount an existing EFS Volume.
462+
Option 2, you have access to the `aws_efs_fs_id` attributes, which will mount an existing EFS Volume. If the volume have mount targets already created, set `aws_efs_create_mount_target` to false.
463+
464+
If you set `aws_efs_create_mount_target` and `aws_efs_create_ha`, mount targets will be created for all of the availability zones of the region.
420465

421466
## Adding external RDS Database
422467

0 commit comments

Comments
 (0)