Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded terraform to version 0.13 #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Local .terraform directories
**/.terraform/*
*.terraform.*
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 2.0.0

ENHANCEMENTS:
* Upgraded terraform version to 0.13 [#16](https://github.com/zoitech/terraform-aws-concourse/issues/16)

BACKWARDS INCOMPATIBILITIES / NOTES:
* Works with terraform 0.13.x


## 1.2.0
NEW FEATURES:
* Add postgres_family variable
99 changes: 99 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -68,3 +68,102 @@ Module managed by [Zoi](https://github.com/zoitech).

## License
MIT License. See LICENSE for full details.
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
| <a name="provider_random"></a> [random](#provider\_random) | n/a |
| <a name="provider_template"></a> [template](#provider\_template) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_db_event_subscription.postgres](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_event_subscription) | resource |
| [aws_db_instance.postgres](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance) | resource |
| [aws_db_parameter_group.concourse](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource |
| [aws_db_subnet_group.postgres](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_subnet_group) | resource |
| [aws_iam_instance_profile.ec2_role_profile](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_instance_profile) | resource |
| [aws_iam_role.ec2_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.ec2_role_admin](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_instance.ec2_docker_instance](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance) | resource |
| [aws_lb.concourse](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb) | resource |
| [aws_lb_listener.concource_http](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener) | resource |
| [aws_lb_listener.concource_https](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener) | resource |
| [aws_lb_target_group.concourse](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource |
| [aws_lb_target_group_attachment.concourse](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group_attachment) | resource |
| [aws_s3_bucket.log_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
| [aws_s3_bucket_object.concourse_alb_access_logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_object) | resource |
| [aws_security_group.GroupLB](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
| [aws_security_group.GroupWS](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
| [aws_security_group.RuleGroupLBHttpIn](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
| [aws_security_group.RuleGroupWsIn](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
| [aws_sns_topic.postgres](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource |
| [random_string.concourse_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
| [random_string.postgres_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
| [aws_ami.coreos](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami) | data source |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_iam_policy_document.allow_alb_loggin_access](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [template_file.userdata](https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/file) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_alb_sg_id"></a> [alb\_sg\_id](#input\_alb\_sg\_id) | The Security Group ID/s which should be attached to the Loadbalancer. | `list(string)` | n/a | yes |
| <a name="input_certificate_arn"></a> [certificate\_arn](#input\_certificate\_arn) | ARN of the certificate. | `string` | `""` | no |
| <a name="input_concourse_db_size"></a> [concourse\_db\_size](#input\_concourse\_db\_size) | Size of the DB Instance. | `string` | `"db.t2.micro"` | no |
| <a name="input_concourse_db_storage"></a> [concourse\_db\_storage](#input\_concourse\_db\_storage) | Size of the DB Disk. | `string` | `"100"` | no |
| <a name="input_concourse_external_url"></a> [concourse\_external\_url](#input\_concourse\_external\_url) | The external URL (including http://) of the Concourse server. | `string` | `""` | no |
| <a name="input_concourse_password"></a> [concourse\_password](#input\_concourse\_password) | The Password for the default user on the Concourse Server. | `string` | `""` | no |
| <a name="input_concourse_username"></a> [concourse\_username](#input\_concourse\_username) | The Username for the default user on the Concourse Server. | `string` | `"concourse"` | no |
| <a name="input_concourse_version"></a> [concourse\_version](#input\_concourse\_version) | The Concourse version to launch. | `string` | `"3.4.1"` | no |
| <a name="input_coreos_version"></a> [coreos\_version](#input\_coreos\_version) | The CoreOS version to launch. | `string` | `"stable-"` | no |
| <a name="input_enable_alb_access_logs"></a> [enable\_alb\_access\_logs](#input\_enable\_alb\_access\_logs) | Turn alb access logs on or off. | `bool` | `false` | no |
| <a name="input_instance_ami"></a> [instance\_ami](#input\_instance\_ami) | ami | `any` | n/a | yes |
| <a name="input_instance_key_name"></a> [instance\_key\_name](#input\_instance\_key\_name) | The SSH key to use for connecting to the instance. | `any` | n/a | yes |
| <a name="input_instance_name"></a> [instance\_name](#input\_instance\_name) | The name of the Instance. | `string` | `"concourse"` | no |
| <a name="input_instance_sg_id"></a> [instance\_sg\_id](#input\_instance\_sg\_id) | The Security Group ID/s which should be attached to the Instance. | `list(string)` | n/a | yes |
| <a name="input_instance_size"></a> [instance\_size](#input\_instance\_size) | The size of the Instance's disk. | `string` | `"t2.medium"` | no |
| <a name="input_instance_volume_size"></a> [instance\_volume\_size](#input\_instance\_volume\_size) | Custom volume size for concourse | `string` | `"60"` | no |
| <a name="input_lifecycle_rule_enabled"></a> [lifecycle\_rule\_enabled](#input\_lifecycle\_rule\_enabled) | To enable the lifecycle rule | `bool` | `false` | no |
| <a name="input_lifecycle_rule_expiration"></a> [lifecycle\_rule\_expiration](#input\_lifecycle\_rule\_expiration) | Delete log files X days after creation | `number` | `90` | no |
| <a name="input_lifecycle_rule_id"></a> [lifecycle\_rule\_id](#input\_lifecycle\_rule\_id) | Name of the lifecyle rule id. | `string` | `""` | no |
| <a name="input_lifecycle_rule_prefix"></a> [lifecycle\_rule\_prefix](#input\_lifecycle\_rule\_prefix) | Lifecycle rule prefix. | `string` | `""` | no |
| <a name="input_postgres_family"></a> [postgres\_family](#input\_postgres\_family) | The Postgres Family to use. | `string` | `"postgres9.5"` | no |
| <a name="input_postgres_multiaz"></a> [postgres\_multiaz](#input\_postgres\_multiaz) | n/a | `string` | `"0"` | no |
| <a name="input_postgres_password"></a> [postgres\_password](#input\_postgres\_password) | The Password for the Postgres database. | `string` | `""` | no |
| <a name="input_postgres_username"></a> [postgres\_username](#input\_postgres\_username) | The Username for the Postgres database. | `string` | `"dbadmin"` | no |
| <a name="input_postgres_version"></a> [postgres\_version](#input\_postgres\_version) | The Postgres Version to use. | `string` | `"9.5.10"` | no |
| <a name="input_prefix"></a> [prefix](#input\_prefix) | A prefix which is added to each ressource. | `string` | `"prod"` | no |
| <a name="input_principle_account_id"></a> [principle\_account\_id](#input\_principle\_account\_id) | Set principle account ID for the region | `string` | `"156460612806"` | no |
| <a name="input_private_sn"></a> [private\_sn](#input\_private\_sn) | The Public Subnets in which the EC2 Instance should be created. | `list(string)` | n/a | yes |
| <a name="input_public_sn"></a> [public\_sn](#input\_public\_sn) | The Public Subnets in which the LB should be created. | `list(string)` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | The AWS region to run in. | `string` | `"eu-west-1"` | no |
| <a name="input_role_policies"></a> [role\_policies](#input\_role\_policies) | The policies which would be attached to the EC2 Role. | `list(string)` | <pre>[<br> "arn:aws:iam::aws:policy/AdministratorAccess"<br>]</pre> | no |
| <a name="input_s3_log_bucket_Key_name"></a> [s3\_log\_bucket\_Key\_name](#input\_s3\_log\_bucket\_Key\_name) | Name of the folder to store logs in the bucket. | `string` | `""` | no |
| <a name="input_s3_log_bucket_name"></a> [s3\_log\_bucket\_name](#input\_s3\_log\_bucket\_name) | Name of the logs bucket. | `string` | `""` | no |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The VPC Id in which the EC2 Instance should be created. | `any` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_alb_dns_name"></a> [alb\_dns\_name](#output\_alb\_dns\_name) | n/a |
| <a name="output_alb_name"></a> [alb\_name](#output\_alb\_name) | n/a |
| <a name="output_concourse_password"></a> [concourse\_password](#output\_concourse\_password) | n/a |
| <a name="output_instance_id"></a> [instance\_id](#output\_instance\_id) | n/a |
| <a name="output_postgres_password"></a> [postgres\_password](#output\_postgres\_password) | n/a |
| <a name="output_public_ip"></a> [public\_ip](#output\_public\_ip) | n/a |
| <a name="output_url"></a> [url](#output\_url) | n/a |
2 changes: 2 additions & 0 deletions data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data "aws_caller_identity" "current" {
}
4 changes: 0 additions & 4 deletions rds.tf
Original file line number Diff line number Diff line change
@@ -6,10 +6,6 @@ resource "aws_db_subnet_group" "postgres" {
resource "aws_db_parameter_group" "concourse" {
name = "${var.prefix}-concourse-${var.postgres_family}"
family = var.postgres_family

lifecycle = {
create_before_destroy = true
}
}

resource "aws_db_instance" "postgres" {
1 change: 0 additions & 1 deletion s3.tf
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@ resource "aws_s3_bucket" "log_bucket" {

bucket = var.s3_log_bucket_name
acl = "private"
region = var.region
policy = data.aws_iam_policy_document.allow_alb_loggin_access[0].json

lifecycle_rule {
8 changes: 0 additions & 8 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
data "aws_caller_identity" "current" {
}

# Account
provider "aws" {
region = var.region
}

variable "region" {
description = "The AWS region to run in."
default = "eu-west-1"
13 changes: 12 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@

terraform {
required_version = ">= 0.12"
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
}
random = {
source = "hashicorp/random"
}
template = {
source = "hashicorp/template"
}
}
}