Skip to content

Commit cd8dc2e

Browse files
Lingling PengLingling Peng
authored andcommitted
make sure changes happen using the right main.tf
1 parent 03bb575 commit cd8dc2e

File tree

2 files changed

+40
-36
lines changed

2 files changed

+40
-36
lines changed

deployments/stacks/dpe-k8s-deployments/main.tf

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,44 @@
11
locals {
22
git_revision = var.git_revision
3+
4+
# Rename this to the name of your branch
5+
my_branch_name = "dpe-1193"
6+
# Set this to a unique name
7+
my_namespace_name = "linglp-cool-namespace"
8+
# Set this to a unique name
9+
my_application_name_in_argocd = "linglp-cool-application"
10+
}
11+
12+
resource "kubernetes_namespace" "linglp-cool-resource" {
13+
metadata {
14+
name = local.my_namespace_name
15+
}
316
}
17+
18+
resource "kubectl_manifest" "my-argocd-application" {
19+
depends_on = [kubernetes_namespace.linglp-cool-resource]
20+
21+
yaml_body = <<YAML
22+
apiVersion: argoproj.io/v1alpha1
23+
kind: Application
24+
metadata:
25+
name: ${local.my_application_name_in_argocd}
26+
namespace: argocd
27+
spec:
28+
project: default
29+
syncPolicy:
30+
automated:
31+
prune: true
32+
sources:
33+
- repoURL: 'https://github.com/Sage-Bionetworks-Workflows/eks-stack.git'
34+
targetRevision: ${local.my_branch_name}
35+
path: deployments/stacks/dpe-k8s-deployments
36+
destination:
37+
server: 'https://kubernetes.default.svc'
38+
namespace: ${local.my_namespace_name}
39+
YAML
40+
}
41+
442
module "sage-aws-eks-autoscaler" {
543
source = "spacelift.io/sagebionetworks/sage-aws-eks-autoscaler/aws"
644
version = "0.9.0"

main.tf

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,7 @@
1010
# }
1111

1212
locals {
13-
git_branch = "dpe-1193"
14-
my_branch_name = "dpe-1193"
15-
my_namespace_name = "linglp-test"
16-
my_application_name_in_argocd = "linglp-cool-application"
17-
}
18-
19-
resource "kubernetes_namespace" "linglp-test-namespace" {
20-
metadata {
21-
name = local.my_namespace_name
22-
}
23-
}
24-
25-
26-
resource "kubectl_manifest" "my-argocd-application" {
27-
depends_on = [kubernetes_namespace.linglp-test-namespace]
28-
29-
yaml_body = <<YAML
30-
apiVersion: argoproj.io/v1alpha1
31-
kind: Application
32-
metadata:
33-
name: ${local.my_application_name_in_argocd}
34-
namespace: argocd
35-
spec:
36-
project: default
37-
syncPolicy:
38-
automated:
39-
prune: true
40-
sources:
41-
- repoURL: 'https://github.com/Sage-Bionetworks-Workflows/eks-stack.git'
42-
targetRevision: ${local.my_branch_name}
43-
path: deployments/stacks/dpe-k8s-deployments
44-
destination:
45-
server: 'https://kubernetes.default.svc'
46-
namespace: ${local.my_namespace_name}
47-
YAML
13+
git_branch = "main"
4814
}
4915

5016
resource "spacelift_stack" "root_administrative_stack" {
@@ -99,4 +65,4 @@ module "deployments" {
9965
org_sagebase_dnt_dev_aws_integration_id = module.common.org_sagebase_dnt_dev_aws_integration_id
10066
org_sagebase_dpe_prod_aws_integration_id = module.common.org_sagebase_dpe_prod_aws_integration_id
10167
git_branch = local.git_branch
102-
}
68+
}

0 commit comments

Comments
 (0)