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

Suppporting authorization_scopes #61

Closed
oulman opened this issue Dec 15, 2021 · 4 comments · Fixed by #54
Closed

Suppporting authorization_scopes #61

oulman opened this issue Dec 15, 2021 · 4 comments · Fixed by #54

Comments

@oulman
Copy link

oulman commented Dec 15, 2021

Is your request related to a new offering from AWS?

No

Describe the solution you'd like.

#17 added support for authorization_type and authorizer_id but left a commented out block for authorization_scopes. I started digging into seeing what it might take to enable that an ran into a problem since var.integrations is defined as a map(any) and Terraform is erroring with a type constraint because authorization_scopes wants a set of strings.

Looking over the documentation around map(any) it's not obvious to me how to pass in a set via the integrations map without violating the type constraint but perhaps I'm misunderstanding the problem. I started to work on a fork with a var integrations type = map(object({})) but I wanted to reach out here to see what the projects thoughts were on supporting authorization_scopes first.

Thank you!

Additional context

 Error: Invalid value for module argument
│ 
│   on apigw.tf line 27, in module "api_gateway":
│   27:   integrations = {
│   28:     "POST /status" = {
│   29:       lambda_arn             = data.aws_lambda_function.start_status.arn
│   30:       payload_format_version = "2.0"
│   31:       authorization_type     = "JWT"
│   32:       authorizer_id          = aws_apigatewayv2_authorizer.azuread.id
│   33:       authorization_scopes   = toset(["access_as_user"])
│   34:     }
│   35:     "POST /execute" = {
│   36:       integration_type    = "AWS_PROXY"
│   37:       integration_subtype = "StepFunctions-StartExecution"
│   38:       credentials_arn     = data.aws_iam_role.sfn_start_role.arn
│   39:       # Note: jsonencode is used to pass argument as a string
│   40:       request_parameters = jsonencode({
│   41:         StateMachineArn = data.aws_sfn_state_machine.start.arn
│   42:         Input           = "\"{\"environment\": \"${var.stage}\"}\""
│   43:       })
│   44:       payload_format_version = "1.0"
│   45:       timeout_milliseconds   = 12000
│   46:     }
│   47:   }
│ 
│ The given value is not suitable for child module variable "integrations" defined at .terraform/modules/api_gateway/variables.tf:191,1-24: attribute types must all match for conversion to map.
@github-actions
Copy link

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Feb 12, 2022
@github-actions
Copy link

This issue was automatically closed because of stale in 10 days

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2022
@antonbabenko
Copy link
Member

This issue has been resolved in version 5.0.0 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants