Last active
July 5, 2021 14:25
-
-
Save lambdafunc/72b5c80485f649ee6037bd9e515e7946 to your computer and use it in GitHub Desktop.
variables basics in tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| provider "aws" { | |
| region = "us-east-1" | |
| # Not a recommended way, either pass this in as ENV variables | |
| # or configure using aws cli or attach policy to EC2 instance | |
| access_key = "access_key" | |
| secret_key = "secret_key" | |
| } | |
| variable "subnet_cidr_block" { | |
| description = "subnet cidr block" | |
| # Default value if needed | |
| default = "10.0.10.0/24" | |
| # What type of values will be accepted if you want to specify | |
| # type = string | |
| } | |
| resource "aws_vpc" "dev-vpc" { | |
| cidr_block = "10.0.0.0/16" | |
| } | |
| resource "aws_subnet" "dev-subnet" { | |
| vpc_id = aws_vpc.dev-vpc.id | |
| cidr_block = var.subnet_cidr_block | |
| availability_zone = "us-east-1a" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment