Skip to content

Commit

Permalink
update setup-directory
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Aug 8, 2023
1 parent c3e262e commit 1cde487
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
11 changes: 6 additions & 5 deletions examples/full-cluster-tf-upgrade/1.25/eks-console-access.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ data "http" "cluster_roles" {
resource "null_resource" "cluster_roles" {
for_each = local.cluster_roles_map
triggers = {
roles = join(",", [each.key, each.value.url])
}
provisioner "local-exec" {
command = "test -d setup || mkdir setup"
roles = join(",", [each.key, each.value.url])
directory = null_resource.setup_directory.triggers.directory
}
# provisioner "local-exec" {
# command = "test -d setup || mkdir setup"
# }
provisioner "local-exec" {
command = "echo '${data.http.cluster_roles[each.key].body}' > setup/${each.value.name}.yaml"
command = "echo '${data.http.cluster_roles[each.key].body}' > ${self.triggers.directory}/${each.value.name}.yaml"
}
}

Expand Down
10 changes: 10 additions & 0 deletions examples/full-cluster-tf-upgrade/1.25/setup-directory.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "null_resource" "setup_directory" {
triggers = {
directory = format("%v/setup", path.root)
keypair_name = local.keypair_name
}

provisioner "local-exec" {
command = "test -d ${self.triggers.directory} || mkdir -p ${self.triggers.directory}"
}
}
3 changes: 2 additions & 1 deletion examples/full-cluster-tf-upgrade/1.25/tf-run.data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION 1.4.5
VERSION 1.4.6
REMOTE-STATE
COMMENT make sure the private-lb subnet and container subnets are tagged properly (see README.md)
STOP then continue with at step %%NEXT%% (tag:subnets-verified)
Expand Down Expand Up @@ -31,6 +31,7 @@ TAG setup-complete
POLICY

TAG ec2-key
null_resource.setup_directory
module.cluster_key_pair time_static.timestamp local_sensitive_file.ssh_private_key local_sensitive_file.ssh_public_key local_file.gitignore local_sensitive_file.gitsecret_script
## null_resource.generate_keypair
## aws_key_pair.cluster_keypair
Expand Down

0 comments on commit 1cde487

Please sign in to comment.