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

Docs - add TF deployment snippet #684

Closed
DanyC97 opened this issue Sep 21, 2021 · 2 comments · Fixed by #716
Closed

Docs - add TF deployment snippet #684

DanyC97 opened this issue Sep 21, 2021 · 2 comments · Fixed by #716
Assignees
Labels
documentation Improvements or additions to documentation p2

Comments

@DanyC97
Copy link
Contributor

DanyC97 commented Sep 21, 2021

What were you initially searching for in the docs?

I was looking for an example of how to deploy the layer using terraform. In case the library was published as a public layer (in addition to SAR app) - see more mentioned here would have been perfect as then it was trivial as per the TF docs

Is this related to an existing part of the documentation? Please share a link
in the homepage we have examples for sar/ cdk and so we could maybe have another tab for TF?

Describe how we could make it clearer
Have an example on how it could be done

If you have a proposed update, please share it here
I think a snippet like below will do, folks familiar with TF will understand and tweak it as per their needs

$ cat main.tf
terraform {
  required_version = "~> 0.13"
  required_providers {
    aws = "~> 3.50.0"
  }
}

provider "aws" {
  region = "us-east-1"
  profile = "dev-apptest8"
}

data aws_serverlessapplicationrepository_application app {
  application_id   = "arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer"
  semantic_version = "1.18.0"
}

resource aws_serverlessapplicationrepository_cloudformation_stack deploy_sar_stack {
  name = "aws-lambda-powertools-python-layer-dev"

  application_id = data.aws_serverlessapplicationrepository_application.app.application_id
  semantic_version = data.aws_serverlessapplicationrepository_application.app.semantic_version
  capabilities = [
        "CAPABILITY_IAM",
        "CAPABILITY_NAMED_IAM"
  ]
}
@DanyC97 DanyC97 added the documentation Improvements or additions to documentation label Sep 21, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Sep 21, 2021

Thanks for opening your first issue here! We'll come back to you as soon as we can.

@DanyC97
Copy link
Contributor Author

DanyC97 commented Sep 30, 2021

@am29d 👋 i hope you don't mind i went and pushed a PR to fix the current issue raised.

@heitorlessa heitorlessa linked a pull request Oct 1, 2021 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants