I’m continuously getting below error when trying to deploy code files using AWS CodePipeline service, the same code files work with Azure DevOps pipeline. Please can someone help.
Initializing the backend…
74 Error: Variables not allowed
76 on main.tf line 8, in terraform:
77 8: bucket = backend_s3_bucket_name
79 Variables may not be used here.
82 Error: Variables not allowed
84 on main.tf line 9, in terraform:
85 9: key = backend_key
87 Variables may not be used here.
90 Error: Variables not allowed
92 on main.tf line 10, in terraform:
93 10: region = backend_s3_region
95 Variables may not be used here.
Since you didn’t share your configuration I can’t be sure, but from the snippets included in the error message it seems like you have some invalid syntax here:
bucket is not a direct argument inside a
terraform block. I think perhaps you intended to place it inside a
backend "s3" block nested within the
terraform block, or similar.
- These backend configuration arguments expect literal values rather than variables. Where they are strings, that will generally mean values given in quotes, like
bucket = "example".
If the above doesn’t answer your question then it would help if you could share your configuration and say a little more about what you are trying to achieve. Thanks!