Merge pull request #2102 from fonsecas72/hcl-terraform-sample
Adding terraform / hcl samplespull/2161/head
commit
f4b71344e5
|
@ -100,6 +100,10 @@ define([], function() { return[
|
|||
"name": "sample.handlebars.txt",
|
||||
"content": "\n<div class=\"entry\">\n\t<h1>{{title}}</h1>\n\t{{#if author}}\n\t<h2>{{author.firstName}} {{author.lastName}}</h2>\n\t{{else}}\n\t<h2>Unknown Author</h2>\n\t{{/if}}\n\t{{contentBody}}\n</div>\n\n{{#unless license}}\n <h3 class=\"warning\">WARNING: This entry does not have a license!</h3>\n{{/unless}}\n\n<div class=\"footnotes\">\n\t<ul>\n\t\t{{#each footnotes}}\n\t\t<li>{{this}}</li>\n\t\t{{/each}}\n\t</ul>\n</div>\n\n<h1>Comments</h1>\n\n<div id=\"comments\">\n\t{{#each comments}}\n\t<h2><a href=\"/posts/{{../permalink}}#{{id}}\">{{title}}</a></h2>\n\t<div>{{body}}</div>\n\t{{/each}}\n</div>\n"
|
||||
},
|
||||
{
|
||||
"name": "sample.hcl.txt",
|
||||
"content": "terraform {\r\n required_providers {\r\n aws = {\r\n source = \"hashicorp/aws\"\r\n version = \"~> 1.0.4\"\r\n }\r\n }\r\n}\r\n\r\nvariable \"aws_region\" {}\r\n\r\nvariable \"base_cidr_block\" {\r\n description = \"A /16 CIDR range definition, such as 10.1.0.0/16, that the VPC will use\"\r\n default = \"10.1.0.0/16\"\r\n}\r\n\r\nvariable \"availability_zones\" {\r\n description = \"A list of availability zones in which to create subnets\"\r\n type = list(string)\r\n}\r\n\r\nprovider \"aws\" {\r\n region = var.aws_region\r\n}\r\n\r\nresource \"aws_vpc\" \"main\" {\r\n # Referencing the base_cidr_block variable allows the network address\r\n # to be changed without modifying the configuration.\r\n cidr_block = var.base_cidr_block\r\n}\r\n\r\nresource \"aws_subnet\" \"az\" {\r\n # Create one subnet for each given availability zone.\r\n count = length(var.availability_zones)\r\n\r\n # For each subnet, use one of the specified availability zones.\r\n availability_zone = var.availability_zones[count.index]\r\n\r\n # By referencing the aws_vpc.main object, Terraform knows that the subnet\r\n # must be created only after the VPC is created.\r\n vpc_id = aws_vpc.main.id\r\n\r\n # Built-in functions and operators can be used for simple transformations of\r\n # values, such as computing a subnet address. Here we create a /20 prefix for\r\n # each subnet, using consecutive addresses for each availability zone,\r\n # such as 10.1.16.0/20 .\r\n cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 4, count.index+1)\r\n}\r\n"
|
||||
},
|
||||
{
|
||||
"name": "sample.html.txt",
|
||||
"content": "<!DOCTYPE HTML>\r\n<!--Example of comments in HTML-->\r\n<html>\r\n<head>\r\n\t<!--This is the head section-->\r\n\t<title>HTML Sample</title>\r\n\t<meta charset=\"utf-8\">\r\n\r\n\t<!--This is the style tag to set style on elements-->\r\n\t<style type=\"text/css\">\r\n\t\th1\r\n\t\t{\r\n\t\t\tfont-family: Tahoma;\r\n\t\t\tfont-size: 40px;\r\n\t\t\tfont-weight: normal;\r\n\t\t\tmargin: 50px;\r\n\t\t\tcolor: #a0a0a0;\r\n\t\t}\r\n\r\n\t\th2\r\n\t\t{\r\n\t\t\tfont-family: Tahoma;\r\n\t\t\tfont-size: 30px;\r\n\t\t\tfont-weight: normal;\r\n\t\t\tmargin: 50px;\r\n\t\t\tcolor: #fff;\r\n\t\t}\r\n\r\n\t\tp\r\n\t\t{\r\n\t\t\tfont-family: Tahoma;\r\n\t\t\tfont-size: 17px;\r\n\t\t\tfont-weight: normal;\r\n\t\t\tmargin: 0px 200px;\r\n\t\t\tcolor: #fff;\r\n\t\t}\r\n\r\n\t\tdiv.Center\r\n\t\t{\r\n\t\t\ttext-align: center;\r\n\t\t}\r\n\r\n\t\tdiv.Blue\r\n\t\t{\r\n\t\t\tpadding: 50px;\r\n\t\t\tbackground-color: #7bd2ff;\r\n\t\t}\r\n\r\n\t\tbutton.Gray\r\n\t\t{\r\n\t\t\tfont-family: Tahoma;\r\n\t\t\tfont-size: 17px;\r\n\t\t\tfont-weight: normal;\r\n\t\t\tmargin-top: 100px;\r\n\t\t\tpadding: 10px 50px;\r\n\t\t\tbackground-color: #727272;\r\n\t\t\tcolor: #fff;\r\n\t\t\toutline: 0;\r\n \t\t\tborder: none;\r\n \t\t\tcursor: pointer;\r\n\t\t}\r\n\r\n\t\tbutton.Gray:hover\r\n\t\t{\r\n\t\t\tbackground-color: #898888;\r\n\t\t}\r\n\r\n\t\tbutton.Gray:active\r\n\t\t{\r\n\t\t\tbackground-color: #636161;\r\n\t\t}\r\n\r\n\t</style>\r\n\r\n\t<!--This is the script tag-->\r\n\t<script type=\"text/javascript\">\r\n\t\tfunction ButtonClick(){\r\n\t\t\t// Example of comments in JavaScript\r\n\t\t\twindow.alert(\"I'm an alert sample!\");\r\n\t\t}\r\n\t</script>\r\n</head>\r\n<body>\r\n\t<!--This is the body section-->\r\n\t<div class=\"Center\">\r\n\t\t<h1>NAME OF SITE</h1>\r\n\t</div>\r\n\t<div class=\"Center Blue\">\r\n\t\t\t<h2>I'm h2 Header! Edit me in <h2></h2>\r\n\t\t\t<p>\r\n\t\t\t\tI'm a paragraph! Edit me in <p>\r\n\t\t\t\tto add your own content and make changes to the style and font.\r\n\t\t\t\tIt's easy! Just change the text between <p> ... </p> and change the style in <style>.\r\n\t\t\t\tYou can make it as long as you wish. The browser will automatically wrap the lines to accommodate the\r\n\t\t\t\tsize of the browser window.\r\n\t\t\t</p>\r\n\t\t\t<button class=\"Gray\" onclick=\"ButtonClick()\">Click Me!</button>\r\n\t</div>\r\n</body>\r\n</html>\r\n"
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = "~> 1.0.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "aws_region" {}
|
||||
|
||||
variable "base_cidr_block" {
|
||||
description = "A /16 CIDR range definition, such as 10.1.0.0/16, that the VPC will use"
|
||||
default = "10.1.0.0/16"
|
||||
}
|
||||
|
||||
variable "availability_zones" {
|
||||
description = "A list of availability zones in which to create subnets"
|
||||
type = list(string)
|
||||
}
|
||||
|
||||
provider "aws" {
|
||||
region = var.aws_region
|
||||
}
|
||||
|
||||
resource "aws_vpc" "main" {
|
||||
# Referencing the base_cidr_block variable allows the network address
|
||||
# to be changed without modifying the configuration.
|
||||
cidr_block = var.base_cidr_block
|
||||
}
|
||||
|
||||
resource "aws_subnet" "az" {
|
||||
# Create one subnet for each given availability zone.
|
||||
count = length(var.availability_zones)
|
||||
|
||||
# For each subnet, use one of the specified availability zones.
|
||||
availability_zone = var.availability_zones[count.index]
|
||||
|
||||
# By referencing the aws_vpc.main object, Terraform knows that the subnet
|
||||
# must be created only after the VPC is created.
|
||||
vpc_id = aws_vpc.main.id
|
||||
|
||||
# Built-in functions and operators can be used for simple transformations of
|
||||
# values, such as computing a subnet address. Here we create a /20 prefix for
|
||||
# each subnet, using consecutive addresses for each availability zone,
|
||||
# such as 10.1.16.0/20 .
|
||||
cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 4, count.index+1)
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = "~> 1.0.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "aws_region" {}
|
||||
|
||||
variable "base_cidr_block" {
|
||||
description = "A /16 CIDR range definition, such as 10.1.0.0/16, that the VPC will use"
|
||||
default = "10.1.0.0/16"
|
||||
}
|
||||
|
||||
variable "availability_zones" {
|
||||
description = "A list of availability zones in which to create subnets"
|
||||
type = list(string)
|
||||
}
|
||||
|
||||
provider "aws" {
|
||||
region = var.aws_region
|
||||
}
|
||||
|
||||
resource "aws_vpc" "main" {
|
||||
# Referencing the base_cidr_block variable allows the network address
|
||||
# to be changed without modifying the configuration.
|
||||
cidr_block = var.base_cidr_block
|
||||
}
|
||||
|
||||
resource "aws_subnet" "az" {
|
||||
# Create one subnet for each given availability zone.
|
||||
count = length(var.availability_zones)
|
||||
|
||||
# For each subnet, use one of the specified availability zones.
|
||||
availability_zone = var.availability_zones[count.index]
|
||||
|
||||
# By referencing the aws_vpc.main object, Terraform knows that the subnet
|
||||
# must be created only after the VPC is created.
|
||||
vpc_id = aws_vpc.main.id
|
||||
|
||||
# Built-in functions and operators can be used for simple transformations of
|
||||
# values, such as computing a subnet address. Here we create a /20 prefix for
|
||||
# each subnet, using consecutive addresses for each availability zone,
|
||||
# such as 10.1.16.0/20 .
|
||||
cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 4, count.index+1)
|
||||
}
|
Loading…
Reference in New Issue