File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ module "cloud-key-rotator" {
4444* (Optional) ` config_data = <string> ` -> Pass a json blob from any source containing your config file.
4545* (Optional) ` enable_ssm_location = false ` -> Whether to create an IAM policy allowing ` ssm:PutParameter ` .
4646Set this to ` true ` if using SSM as a ` cloud-key-rotator ` location.
47+ * (Optional) ` region = <string> ` -> pass aws region. Defaults to ` eu-west-1 ` if not set.
4748
4849## Usage - GCP
4950
9596 service account and scheduler job names to prevent naming conflicts
9697* (Optional) ` ckr_schedule = "0 10 * * 1-5" ` -> Defaults to triggering 10am Monday-Friday.
9798* (Optional) ` ckr_schedule_time_zone = "Europe/London" ` -> The time zone for the scheduler job. Defaults to Europe/London
98- * (Optional)
` deploying_accounts = ["serviceAccount:[email protected] "] ` -> Any accounts which
99- will be deploying the CKR terraform but do not have the iam.serviceAccountUser permission for the whole project. This
100- gives the supplied accounts iam.serviceAccountUser permissions for the Cloud Key Rotator service account which is
99+ * (Optional)
` deploying_accounts = ["serviceAccount:[email protected] "] ` -> Any accounts which
100+ will be deploying the CKR terraform but do not have the iam.serviceAccountUser permission for the whole project. This
101+ gives the supplied accounts iam.serviceAccountUser permissions for the Cloud Key Rotator service account which is
101102 necessary to deploy the terraform module. Defaults to an empty list
Original file line number Diff line number Diff line change @@ -119,14 +119,14 @@ resource "aws_iam_policy" "ckr_log_policy" {
119119 "logs:PutLogEvents"
120120 ],
121121 "Resource": [
122- "arn:aws:logs:eu-west-1 :${ local . account_id } :log-stream:*:*:*",
123- "arn:aws:logs:eu-west-1 :${ local . account_id } :log-group:/aws/lambda/cloud-key-*"
122+ "arn:aws:logs:${ var . region } :${ local . account_id } :log-stream:*:*:*",
123+ "arn:aws:logs:${ var . region } :${ local . account_id } :log-group:/aws/lambda/cloud-key-*"
124124 ]
125125 },
126126 {
127127 "Effect": "Allow",
128128 "Action": "logs:CreateLogGroup",
129- "Resource": "arn:aws:logs:eu-west-1 :${ local . account_id } :*"
129+ "Resource": "arn:aws:logs:${ var . region } :${ local . account_id } :*"
130130 }
131131 ]
132132}
@@ -150,7 +150,7 @@ resource "aws_iam_policy" "ckr_ssm_policy" {
150150 "ssm:PutParameter"
151151 ],
152152 "Resource": [
153- "arn:aws:ssm:eu-west-1 :${ local . account_id } :parameter/*"
153+ "arn:aws:ssm:${ var . region } :${ local . account_id } :parameter/*"
154154 ]
155155 }
156156 ]
Original file line number Diff line number Diff line change @@ -17,3 +17,8 @@ variable "enable_ssm_location" {
1717variable "ckr_trigger_description" {
1818 default = " Scheduled cloud key rotation"
1919}
20+
21+ variable "region" {
22+ type = string
23+ default = " eu-west-1"
24+ }
You can’t perform that action at this time.
0 commit comments