Skip to content

Commit

Permalink
changing variable name cluster_name to network_name
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Arnold committed Jun 20, 2018
1 parent c549c08 commit f49f5bf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ resource "aws_instance" "bastion" {

key_name = "${var.key_name}"
iam_instance_profile = "${aws_iam_instance_profile.ansible_ec2.name}"
tags = "${merge(map("cluster", "${var.cluster_name}"), var.resource_tags)}"
tags = "${merge(map("network", "${var.network_name}", "Name", "${var.network_name}-bastion"), var.resource_tags)}"
}
12 changes: 6 additions & 6 deletions instance_profile.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
resource "aws_iam_instance_profile" "ansible_ec2" {
name = "${var.cluster_name}-ec2-ro"
resource "aws_iam_instance_profile" "bastion_ro" {
name = "${var.network_name}-ec2-ro"
role = "${aws_iam_role.ansible_ec2.name}"
}

resource "aws_iam_policy" "ansible_ec2" {
name = "${var.cluster_name}-ec2-ro"
resource "aws_iam_policy" "bastion_ro" {
name = "${var.network_name}-ec2-ro"
path = "/"
policy = "${file("${path.module}/policy.json")}"
}

resource "aws_iam_role_policy_attachment" "ansible_ec2" {
resource "aws_iam_role_policy_attachment" "bastion_ro" {
role = "${aws_iam_role.ansible_ec2.name}"
policy_arn = "${aws_iam_policy.ansible_ec2.arn}"
}

resource "aws_iam_role" "ansible_ec2" {
name = "${var.cluster_name}-ec2-ro"
name = "${var.network_name}-ec2-ro"
path = "/"

assume_role_policy = "${file("${path.module}/role.json")}"
Expand Down
2 changes: 1 addition & 1 deletion sec_groups.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_security_group" "bastion" {
name = "${var.cluster_name}-bastion"
name = "${var.network_name}-bastion"
vpc_id = "${var.vpc_id}"

ingress {
Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ variable "resource_tags" {
default = {}
}

variable "cluster_name" {
description = "Name of the cluster this bastion host will allow access to"
variable "network_name" {
description = "Name of the network this bastion host will allow access to"
type = "string"
}

0 comments on commit f49f5bf

Please sign in to comment.