0

Is it possible to create a new REST api gateway using codepipeline? I already have a terraform script to create the pipeline, but I want to know if there is a way to create a pipeline that will take my script and propogate it from a dev environment api gateway to a test environment? I am trying to automate the pipeline to possibly run the script for me once the code is updated in a code commit stash

Any suggestions would be greatly appreciated.

1 Answer 1

1

To run a script from AWS CodePipeline you can use AWS CodeBuild action in one of your CodePipeline stages.

With CodeBuild you can specify the list of commands you want to run, like installing and running terraform.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, so if my script is in the code commit repoistory, what would my buildspec file have to do, install terraform, then switch to the codecommit repository? or because the repository is already the source for the pipeline will it automatically pick up my tf files?
I was able to get the pipeline to install terraform but now since my script has modules that are outside of the code commit stash, how can I get the pipeline access to that repository?
You need to pull the modules the same way you'd do on your local. Aren't the modules just downloaded via terraform init ?
they weren't in the local stash, I have since moved them to the stash with the rest of the code so this is fixed now. Thank you so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.