Skip to content

Commit

Permalink
Removing provider block
Browse files Browse the repository at this point in the history
  • Loading branch information
jnonino committed May 5, 2020
1 parent 13a151f commit a6127b4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 37 deletions.
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ jobs:
- image: hashicorp/terraform
steps:
- checkout
- run: terraform init
- run: terraform validate
- run:
working_directory: examples/test
command: terraform init
- run:
working_directory: examples/test
command: terraform validate
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ Check valid versions on:
* Github Releases: <https://github.com/cn-terraform/terraform-aws-ec2-asg/releases>
* Terraform Module Registry: <https://registry.terraform.io/modules/cn-terraform/ec2-asg/aws>

module "ec2-asg" {
source = "cn-terraform/ec2-asg/aws"
version = "1.0.2"
name_preffix = var.name_preffix
profile = var.profile
region = var.region
image_id = var.image_id
instance_type = var.instance_type
max_size = var.max_size
min_size = var.min_size
availability_zones = var.availability_zones
}

In the example only required values are show, but you can configure all values for this resources. Check documentation on: <https://registry.terraform.io/modules/cn-terraform/ec2-asg/aws>

## Output values
* lc_name: The name of the launch configuration.
* lc_id: The ID of the launch configuration.
Expand Down
15 changes: 15 additions & 0 deletions examples/test/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
provider "aws" {
region = "us-east-1"
}

module "asg" {
source = "../../"
name_preffix = "test"
image_id = "ami-00579fbb15b954340"
instance_type = "t3.micro"
associate_public_ip_address = true
max_size = 3
min_size = 1
}


8 changes: 0 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# ---------------------------------------------------------------------------------------------------------------------
# PROVIDER
# ---------------------------------------------------------------------------------------------------------------------
provider "aws" {
profile = var.profile
region = var.region
}

# ---------------------------------------------------------------------------------------------------------------------
# Launch Configuration
# ---------------------------------------------------------------------------------------------------------------------
Expand Down
13 changes: 1 addition & 12 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ variable "name_preffix" {
description = "Name preffix for resources on AWS"
}

# ---------------------------------------------------------------------------------------------------------------------
# AWS CREDENTIALS AND REGION
# ---------------------------------------------------------------------------------------------------------------------
variable "profile" {
description = "AWS API key credentials to use"
}

variable "region" {
description = "AWS Region the infrastructure is hosted in"
}

# ---------------------------------------------------------------------------------------------------------------------
# AWS EC2 LAUNCH CONFIGURATION
# ---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -194,6 +183,6 @@ variable "service_linked_role_arn" {
default = ""
}
# NOT CONSIDERED
# launch_template - (Optional) Nested argument with Launch template specification to use to launch instances.
# launch_template - (Optional) Nested argument with Launch template specification to use to launch instances.
# mixed_instances_policy (Optional) Configuration block containing settings to define launch targets for Auto Scaling groups. Defined below.
# initial_lifecycle_hook - (Optional) One or more Lifecycle Hooks to attach to the autoscaling group before instances are launched. The syntax is exactly the same as the separate aws_autoscaling_lifecycle_hook resource, without the autoscaling_group_name attribute. Please note that this will only work when creating a new autoscaling group. For all other use-cases, please use aws_autoscaling_lifecycle_hook resource.

0 comments on commit a6127b4

Please sign in to comment.