INFRA-43| Deepak Jain| adding test
This commit is contained in:
21
testdata/m1_basic/expected_output/aws-roles-tf/deploy.sh
vendored
Executable file
21
testdata/m1_basic/expected_output/aws-roles-tf/deploy.sh
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit when any command fails
|
||||
set -e
|
||||
|
||||
additional_terraform_options=""
|
||||
additional_kube_options=""
|
||||
|
||||
terraform_action=${1:-apply}
|
||||
if [ $terraform_action == "apply" ];then
|
||||
additional_terraform_options="${additional_terraform_options} -auto-approve"
|
||||
else
|
||||
additional_kube_options="${additional_kube_options} --dry-run"
|
||||
fi
|
||||
|
||||
terraform init
|
||||
terraform workspace select nonprod.np.navi-tech.in || terraform workspace new nonprod.np.navi-tech.in
|
||||
terraform $terraform_action $additional_terraform_options
|
||||
|
||||
kubectl config use-context ${CLUSTER}
|
||||
kubectl apply -f foo-navi-service-dev.yaml -n ${NAMESPACE} $additional_kube_options
|
||||
17
testdata/m1_basic/expected_output/aws-roles-tf/main.tf
vendored
Executable file
17
testdata/m1_basic/expected_output/aws-roles-tf/main.tf
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "navi-bank-terraform-nonprod-state"
|
||||
region = "ap-south-1"
|
||||
key = "service-iam-roles"
|
||||
workspace_key_prefix = "iamroles/dev/foo-navi-service"
|
||||
profile = "nonprod"
|
||||
acl = "bucket-owner-full-control"
|
||||
}
|
||||
}
|
||||
|
||||
module "iam-role" {
|
||||
source = "git::ssh://git@github.cmd.navi-tech.in/navi-infra/iam-roles.git"
|
||||
environment = "dev"
|
||||
service_role = {"policies":[{"actions":["s3:GetObject","s3:PutObject"],"resource":"arn:aws:s3:::navi-e3e2a9bfd88566b05001b02a3f51d286/*"},{"actions":["s3:GetObject","s3:PutObject"],"resource":"*"},{"actions":["sns:Publish","sns:SetSMSAttributes"],"resource":"arn:aws:s3:::arn:aws:s3:::test-bucket-to-be-deleted/*"}]}
|
||||
role_name = "foo-navi-service"
|
||||
}
|
||||
Reference in New Issue
Block a user