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
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", | |
"name": "Annotations & Alerts", |
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
2018/11/07 15:13:18 [INFO] Packer version: 1.3.2 | |
2018/11/07 15:13:18 Packer Target OS/Arch: linux amd64 | |
2018/11/07 15:13:18 Built with Go Version: go1.11.1 | |
2018/11/07 15:13:18 Detected home directory from env var: /home/yongwen | |
2018/11/07 15:13:18 Using internal plugin for ncloud | |
2018/11/07 15:13:18 Using internal plugin for alicloud-ecs | |
2018/11/07 15:13:18 Using internal plugin for azure-arm | |
2018/11/07 15:13:18 Using internal plugin for cloudstack | |
2018/11/07 15:13:18 Using internal plugin for triton | |
2018/11/07 15:13:18 Using internal plugin for lxd |
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
resource "aws_instance" "instance" { | |
ami = "${data.aws_ami.ubuntu.id}" | |
instance_type = "${var.instance_type}" | |
key_name = "${var.ssh_key_name}" | |
subnet_id = "${var.subnet_id}" | |
vpc_security_group_ids = ["${aws_security_group.instance.id}"] | |
tags = "${merge(var.tags, map("Name", "${var.name}"))}" | |
volume_tags = "${merge(var.tags, map("Name", "${var.name}"))}" |
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
data "aws_ami" "ubuntu" { | |
most_recent = true | |
filter { | |
name = "name" | |
values = ["ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*"] | |
} | |
filter { | |
name = "virtualization-type" |
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
resource "aws_security_group" "instance" { | |
name = "${var.name}" | |
vpc_id = "${var.vpc_id}" | |
tags = "${merge(var.tags, map("Name", "${var.name}"))}" | |
} | |
resource "aws_security_group_rule" "ssh_inbound" { | |
type = "ingress" | |
from_port = 22 |
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
data "aws_caller_identity" "current" {} | |
data "aws_region" "current" {} | |
module "secure-baseline" { | |
source = "nozaq/secure-baseline/aws" | |
audit_log_bucket_name = "YOUR_BUCKET_NAME" | |
aws_account_id = "${data.aws_caller_identity.current.account_id}" | |
region = "${data.aws_region.current.name}" | |
support_iam_role_principal_arn = "YOUR_IAM_USER" |
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
# This file manages Route53 records | |
data "aws_route53_zone" "domain" { | |
name = "${var.route53_zone}" | |
} | |
resource "aws_route53_record" "domain" { | |
zone_id = "${data.aws_route53_zone.domain.zone_id}" | |
name = "${var.domain}" | |
type = "A" |
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
# LB -> Clients | |
resource "aws_security_group_rule" "lb_client_egress" { | |
type = "egress" | |
from_port = "${local.client_port}" | |
to_port = "${local.client_port}" | |
protocol = "tcp" | |
source_security_group_id = "${aws_security_group.client.id}" | |
security_group_id = "${aws_security_group.lb.id}" | |
} |
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
resource "aws_lb_listener_rule" "client" { | |
listener_arn = "${aws_lb_listener.https.arn}" | |
priority = 100 | |
action { | |
type = "forward" | |
target_group_arn = "${aws_lb_target_group.client.arn}" | |
} | |
condition { |
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
# HTTP listener to redirect to HTTPS | |
resource "aws_lb_listener" "front_end" { | |
load_balancer_arn = "${aws_lb.lb.arn}" | |
port = "80" | |
protocol = "HTTP" | |
default_action { | |
type = "redirect" | |
redirect { |