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

allow ssm:GetParameter with ssm config #61

Open
moritzzimmer opened this issue Jul 1, 2020 · 1 comment · Fixed by moritzzimmer/terraform-aws-lambda#3
Open

allow ssm:GetParameter with ssm config #61

moritzzimmer opened this issue Jul 1, 2020 · 1 comment · Fixed by moritzzimmer/terraform-aws-lambda#3
Assignees
Labels
bug Something isn't working

Comments

@moritzzimmer
Copy link
Contributor

Currently this module configures the following policy for ssm_parameter_names:

data "aws_iam_policy_document" "ssm_policy_document" {
  count = length(var.ssm_parameter_names)

  statement {
    actions = [
      "ssm:GetParameters",
      "ssm:GetParametersByPath",
    ]

    resources = [
      "arn:aws:ssm:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:parameter/${element(var.ssm_parameter_names, count.index)}",
    ]
  }
}

This datasource should also permit ssm:GetParameter.

@moritzzimmer moritzzimmer added the bug Something isn't working label Jul 1, 2020
@moritzzimmer moritzzimmer self-assigned this Jul 1, 2020
@moritzzimmer moritzzimmer changed the title allow ssm:GetParameters with ssm config allow ssm:GetParameter with ssm config Jul 1, 2020
moritzzimmer added a commit to moritzzimmer/terraform-aws-lambda that referenced this issue Aug 28, 2020
- custom object which can be enhanced for kms_key later
- adapted documentation and added example
- allow `ssm:GetParameter`

for spring-media users, this fixes spring-media/terraform-aws-lambda#61 and spring-media/terraform-aws-lambda#59
moritzzimmer added a commit to moritzzimmer/terraform-aws-lambda that referenced this issue Aug 28, 2020
* streamlined tests and variables

- use objects in favour of maps to have a more precise API and documentation (those are interchangeable from a client perspective)
- use lambda fixture in all tests
- streamlined examples
- added deprecation comments for ssm
- use `kms_key_arn` (also) as described in https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function#kms_key_arn

* new configuration for ssm

- custom object which can be enhanced for kms_key later
- adapted documentation and added example
- allow `ssm:GetParameter`

for spring-media users, this fixes spring-media/terraform-aws-lambda#61 and spring-media/terraform-aws-lambda#59
@moritzzimmer moritzzimmer reopened this Aug 29, 2020
@moritzzimmer
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant