Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions data/data/aws/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ provider "aws" {
region = "us-east-1"
}

resource "aws_s3_bucket" "example" {
}

resource "aws_vpc" "example" {
cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true
Expand All @@ -30,7 +27,6 @@ module "bootstrap" {
source = "github.com/openshift/installer//data/data/aws/bootstrap"

ami = "ami-0af8953af3ec06b7c"
bucket = "${aws_s3_bucket.example.id}"
cluster_name = "my-cluster"
ignition = "{\"ignition\": {\"version\": \"2.2.0\"}}",
subnet_id = "${aws_subnet.example.id}"
Expand Down
14 changes: 12 additions & 2 deletions data/data/aws/bootstrap/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
resource "aws_s3_bucket" "ignition" {
acl = "private"

tags = "${var.tags}"

lifecycle {
ignore_changes = ["*"]
}
}

resource "aws_s3_bucket_object" "ignition" {
bucket = "${var.bucket}"
bucket = "${aws_s3_bucket.ignition.id}"
key = "bootstrap.ign"
content = "${var.ignition}"
acl = "private"
Expand All @@ -15,7 +25,7 @@ resource "aws_s3_bucket_object" "ignition" {

data "ignition_config" "redirect" {
replace {
source = "s3://${var.bucket}/bootstrap.ign"
source = "s3://${aws_s3_bucket.ignition.id}/bootstrap.ign"
}
}

Expand Down
5 changes: 0 additions & 5 deletions data/data/aws/bootstrap/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ variable "associate_public_ip_address" {
description = "If set to true, public-facing ingress resources are created."
}

variable "bucket" {
type = "string"
description = "The S3 bucket name or ID for bootstrap ignition file."
}

variable "cluster_name" {
type = "string"
description = "The name of the cluster."
Expand Down
15 changes: 0 additions & 15 deletions data/data/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module "bootstrap" {

ami = "${var.tectonic_aws_ec2_ami_override}"
associate_public_ip_address = "${var.tectonic_aws_endpoints != "private"}"
bucket = "${aws_s3_bucket.bootstrap.id}"
cluster_name = "${var.tectonic_cluster_name}"
public_target_group_arns = "${module.vpc.aws_lb_public_target_group_arns}"
public_target_group_arns_length = "${module.vpc.aws_lb_public_target_group_arns_length}"
Expand Down Expand Up @@ -136,17 +135,3 @@ resource "aws_route53_zone" "tectonic_int" {
"tectonicClusterID", "${var.tectonic_cluster_id}"
), var.tectonic_aws_extra_tags)}"
}

resource "aws_s3_bucket" "bootstrap" {
acl = "private"

tags = "${merge(map(
"Name", "${var.tectonic_cluster_name}-tectonic",
"KubernetesCluster", "${var.tectonic_cluster_name}",
"tectonicClusterID", "${var.tectonic_cluster_id}"
), var.tectonic_aws_extra_tags)}"

lifecycle {
ignore_changes = ["*"]
}
}