The Wayback Machine - https://web.archive.org/web/20200916060131/https://github.com/aws/chalice/issues/1412
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation issue w.r.t to 'chalice generate-pipeline' and python 3.8 #1412

Open
devangmehta123 opened this issue Apr 30, 2020 · 3 comments
Open

Comments

@devangmehta123
Copy link
Contributor

@devangmehta123 devangmehta123 commented Apr 30, 2020

Even though I have used 'chalice deploy' successfully with python 3.8, 'chalice generate-pipeline' will not work because AWS CodeDeploy does not yet support python 3.8.

It would help if the docs mentioned this and maybe put a timeline for when CodeDeploy plans to add that support.

It would also help if there were instructions to set up a pipeline using github actions. I have found this: https://github.com/marketplace/actions/chalice-extended-action

But I am not sure if it is reliable and in heavy use.

@devangmehta123
Copy link
Contributor Author

@devangmehta123 devangmehta123 commented May 6, 2020

I have read the documentation more closely and I think that that a good way forward is to use the 'chalice package' command to generate a terraform config and it works quite well.

I have been able to create and destroy my environment several times this way.

But I want to configure some more things. For example, I added my own main.tf file to create a VPC and terraform seems to do the right thing by making the lambda function inside this new VPC.

My annoyance now seems to be the setting of certain parameters for terraform. For example, chalice correctly assumes that region should not be hardcoded in the 'aws' provider. But that forces 'terraform plan' and 'terraform apply' to ask this question on the command line.

Ideally, to be able to run terraform without console input. I want to keep chalice.tf.json in source control along with my main.tf which further customizes the environment. Ideally, I should never have to hand edit or merge chalice.tf.json.

I can add the region inside chalice.tf.json but I wish there was a way to override the provider settings from my main.tf file. That way, chalice.tf.json will always be a generated file which is only changed by chalice.

@devangmehta123
Copy link
Contributor Author

@devangmehta123 devangmehta123 commented May 7, 2020

I have made some more progress on this. Terraform cloud integrates very well with github actions. I have been able to trigger the formation of the infrastructure quite easily. At this point, maybe this issue becomes a feature request. What would be helpful is to have something like chalice package --pkg-format terraform --s3-key s3://..... tf-dev. It is still helpful to put generate the TF config file to put inside source control. But the package.zip is probably better off in s3 with the TF file having a link to that object.

@jamesls
Copy link
Member

@jamesls jamesls commented May 28, 2020

Awesome, thanks for the feedback. I like the idea of adding an --s3-key where we can upload the package.zip for you. I'll also look into updating the docs about 3.8.

FWIW, I've not seen https://github.com/marketplace/actions/chalice-extended-action before. It's not something we've created or maintain, but it does look interesting.

jamesls added a commit to jamesls/chalice that referenced this issue Sep 1, 2020
The deployment pipeline generated from the ``generate-pipeline``
command hasn't been touched in several years.  In looking over
the code there's been notable changes in the underlying services
we use for the deployment pipeline:

* There's a new 0.2 version of the CodeBuild buildspec that has
  notable improvements from the 0.1 version buildspec.
* The way that CodeBuild manages language images has changed.
  Rather than having separate codebuild images for each runtime,
  you can now specify the runtime you need in your codebuild spec
  file (leading to issues such as aws#1412).  As a result you couldn't
  generate a deployment pipeline that worked with Python 3.8.
* CloudFormation added support for ssm/ssm-secure/secretsmanager.
  While we can't use ssm-secure for the GitHub OAuth token,
  secretsmanager is supported so we can more securely store our
  token instead of requiring it as a template parameter.

The output of `generate-pipeline` is in a grey area in terms of what to
support for backwards compatibility.  If the expectation is you can use
the output `generate-pipeline` to successfully set up a deployment
pipeline, then these changes are backwards compatible.  However,
the template parameters are changed as well as the CodeBuild image used
which could negatively impact customers.  As a result, I've decided
to make this an opt-in change (for now).  There's a new
`--pipeline-version` parameter where specifying `v2` will get you
the new features listed above.  The default value is `v1` which
will generate the same template as previous versions.
The other benefit of making this opt-in is we can restrict which
Python versions we support.  The new CodeBuild images only support
Python 3.7 and 3.8 so we can only support these new versions without
requiring fallbacks for earlier python version (you can just use
`v1` if you want to use older python versions).

Note that there was a bugfix needed when configuring a GitHub
repository as a source.  This was fixed in the `v1` template
as well as the `v2` template.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.