Skip to content

Commit 6a4eb64

Browse files
authored
Remove generated user data from module (breaking change) (#22)
1 parent 10fad78 commit 6a4eb64

File tree

4 files changed

+6
-46
lines changed

4 files changed

+6
-46
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Included features:
66
* Automatically create a Security Group
77
* Option to switch EIP attachment
88
* CloudWatch monitoring and automatic reboot if instance hangs
9-
* [Github Authorized Keys](https://github.com/cloudposse/terraform-template-user-data-github-authorized-keys)
109
* Assume Role capability
1110

1211
## Usage
@@ -37,9 +36,6 @@ module "instance" {
3736
module "kafka_instance" {
3837
source = "git::https://github.com/cloudposse/terraform-aws-ec2-instance.git?ref=master"
3938
ssh_key_pair = "${var.ssh_key_pair}"
40-
github_api_token = "${var.github_api_token}"
41-
github_organization = "${var.github_organization}"
42-
github_team = "${var.github_team}"
4339
vpc_id = "${var.vpc_id}"
4440
security_groups = ["${var.security_groups}"]
4541
subnet = "${var.subnet}"
@@ -56,7 +52,6 @@ module "kafka_instance" {
5652
This module depends on these modules:
5753

5854
* [terraform-null-label](https://github.com/cloudposse/terraform-null-label)
59-
* [terraform-template-user-data-github-authorized-keys](https://github.com/cloudposse/terraform-template-user-data-github-authorized-keys)
6055

6156
It is necessary to run `terraform get` to download those modules.
6257

@@ -81,9 +76,6 @@ resource "aws_ami_from_instance" "example" {
8176
| `instance_enabled` | `true` | Flag for creating an instance. Set to false if it is necessary to skip instance creation | No |
8277
| `create_default_security_group` | `true` | Flag for creation default Security Group with Egress traffic allowed only | No |
8378
| `ssh_key_pair` | `` | SSH key pair to be provisioned on instance | Yes |
84-
| `github_api_token` | `` | GitHub API token | No |
85-
| `github_organization` | `` | GitHub organization name | No |
86-
| `github_team` | `` | GitHub team | No |
8779
| `instance_type` | `t2.micro` | The type of the creating instance (e.g. `t2.micro`) | No |
8880
| `vpc_id` | `` | The ID of the VPC that the creating instance security group belongs to | Yes |
8981
| `security_groups` | `[]` | List of Security Group IDs allowed to connect to creating instance | Yes |

main.tf

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,14 @@ resource "aws_iam_role" "default" {
8484
assume_role_policy = "${data.aws_iam_policy_document.default.json}"
8585
}
8686

87-
# Apply the tf_github_authorized_keys module for this resource
88-
module "github_authorized_keys" {
89-
source = "git::https://github.com/cloudposse/terraform-template-user-data-github-authorized-keys.git?ref=tags/0.1.2"
90-
github_api_token = "${var.github_api_token}"
91-
github_organization = "${var.github_organization}"
92-
github_team = "${var.github_team}"
93-
}
94-
9587
resource "aws_instance" "default" {
9688
count = "${local.instance_count}"
9789
ami = "${local.ami}"
9890
availability_zone = "${local.availability_zone}"
9991
instance_type = "${var.instance_type}"
10092
ebs_optimized = "${var.ebs_optimized}"
10193
disable_api_termination = "${var.disable_api_termination}"
102-
user_data = "${data.template_file.user_data.rendered}"
94+
user_data = "${var.user_data}"
10395
iam_instance_profile = "${aws_iam_instance_profile.default.name}"
10496
associate_public_ip_address = "${var.associate_public_ip_address}"
10597
key_name = "${var.ssh_key_pair}"

user_data.tf

Lines changed: 0 additions & 8 deletions
This file was deleted.

variables.tf

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,16 @@ variable "ssh_key_pair" {
22
description = "SSH key pair to be provisioned on instance"
33
}
44

5-
variable "github_api_token" {
6-
description = "GitHub API token"
7-
default = ""
8-
}
9-
10-
variable "github_organization" {
11-
description = "GitHub organization name"
12-
default = ""
13-
}
14-
15-
variable "github_team" {
16-
description = "GitHub team"
17-
default = ""
18-
}
19-
205
variable "associate_public_ip_address" {
216
description = "Associate a public ip address with the creating instance"
227
default = "true"
238
}
249

10+
variable "user_data" {
11+
description = "The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument"
12+
default = ""
13+
}
14+
2515
variable "instance_type" {
2616
description = "The type of the creating instance"
2717
default = "t2.micro"
@@ -104,12 +94,6 @@ variable "monitoring" {
10494
default = "true"
10595
}
10696

107-
variable "user_data" {
108-
description = "User data to provide when launching the instance"
109-
type = "list"
110-
default = []
111-
}
112-
11397
variable "private_ip" {
11498
description = "Private IP address to associate with the instance in a VPC"
11599
default = ""

0 commit comments

Comments
 (0)