Skip to content

Commit

Permalink
Subnet ID as variable (#33)
Browse files Browse the repository at this point in the history
* Subnet ID as variable

* Update readme
  • Loading branch information
plumdog authored and aknysh committed Feb 8, 2019
1 parent 205e542 commit f4b68f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ Available targets:
lint Lint terraform code
```

## Inputs

| Name | Description | Type | Default | Required |
Expand All @@ -163,6 +162,7 @@ Available targets:
| region | (Optional) AWS Region. If not specified, will be derived from 'aws_region' data source | string | `` | no |
| ssh_key_pair | `SSH` key that will be deployed on DataPipeline's instance | string | - | yes |
| stage | Stage (e.g. `prod`, `dev`, `staging`) | string | - | yes |
| subnet_id | Optionally specify the subnet to use | string | `` | no |
| tags | Additional tags (e.g. `map('BusinessUnit`,`XYZ`) | map | `<map>` | no |
| use_ip_address | If set to `true`, will use IP address instead of DNS name to connect to the `EFS` | string | `false` | no |
| vpc_id | VPC ID | string | `` | no |
Expand Down Expand Up @@ -265,7 +265,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

## Copyright

Copyright © 2017-2018 [Cloud Posse, LLC](https://cpco.io/copyright)
Copyright © 2017-2019 [Cloud Posse, LLC](https://cpco.io/copyright)



Expand Down
2 changes: 1 addition & 1 deletion cloudformation.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "aws_cloudformation_stack" "datapipeline" {

parameters {
myInstanceType = "${var.datapipeline_config["instance_type"]}"
mySubnetId = "${data.aws_subnet_ids.default.ids[0]}"
mySubnetId = "${var.subnet_id == "" ? data.aws_subnet_ids.default.ids[0] : var.subnet_id}"
mySecurityGroupId = "${aws_security_group.datapipeline.id}"
myEFSHost = "${var.use_ip_address == "true" ? data.aws_efs_mount_target.default.ip_address : format("%s.efs.%s.amazonaws.com", data.aws_efs_mount_target.default.file_system_id, (signum(length(var.region)) == 1 ? var.region : data.aws_region.default.name))}"
myS3BackupsBucket = "${aws_s3_bucket.backups.id}"
Expand Down
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

## Inputs

| Name | Description | Type | Default | Required |
Expand All @@ -14,6 +13,7 @@
| region | (Optional) AWS Region. If not specified, will be derived from 'aws_region' data source | string | `` | no |
| ssh_key_pair | `SSH` key that will be deployed on DataPipeline's instance | string | - | yes |
| stage | Stage (e.g. `prod`, `dev`, `staging`) | string | - | yes |
| subnet_id | Optionally specify the subnet to use | string | `` | no |
| tags | Additional tags (e.g. `map('BusinessUnit`,`XYZ`) | map | `<map>` | no |
| use_ip_address | If set to `true`, will use IP address instead of DNS name to connect to the `EFS` | string | `false` | no |
| vpc_id | VPC ID | string | `` | no |
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ variable "tags" {
default = {}
description = "Additional tags (e.g. `map('BusinessUnit`,`XYZ`)"
}

variable "subnet_id" {
type = "string"
default = ""
description = "Optionally specify the subnet to use"
}

0 comments on commit f4b68f3

Please sign in to comment.