terraform-aws-modules / terraform-aws-apigateway-v2

Terraform module to create AWS API Gateway v2 (HTTP/WebSocket) πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/apigateway-v2/aws
Apache License 2.0
151 stars 203 forks source link

an input for additional stages #94

Closed flavono123 closed 1 year ago

flavono123 commented 1 year ago

Is your request related to a new offering from AWS?

Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.

5.16.2

Is your request related to a problem? Please describe.

cannot add more stage by module inputs

Describe the solution you'd like.

an input like:

additional_stages = [
  "dev",
  "prod"
]

Describe alternatives you've considered.

maybe have to use resource 😩

module "aws_apigateway_v2" { ... }

resource "aws_apigatewayv2_stage" "example" {
  api_id = module.aws_apigatewayv2_api.this.id
  name   = "dev"
}

resource "aws_apigatewayv2_stage" "example" {
  api_id = module.aws_apigatewayv2_api.this.id
  name   = "dev"
}

Additional context

bryantbiggs commented 1 year ago

I'm not sure how applicable this is in a module. you typically deploy to dev first and later promote to prod, which means that dev stage does not always equal prod. therefore, I think its better to have to module definitions, one for dev and one for prod and you can control them independently to promote changes as needed. but I am open to hear thoughts, feedback

flavono123 commented 1 year ago

image i can add some stages when i create new one in the web console, following a workshop. that makes me suggest like this. i've got what you mean but isn't it make sense?

flavono123 commented 1 year ago

back to my "real" problem, what i want to do with the module, is solved by resources like:

## API Gateway

### API
resource "aws_apigatewayv2_api" "delivery_api" {
  name          = local.apigateway.api_name
  protocol_type = "HTTP"
}

### Deploy/Stages
resource "aws_apigatewayv2_stage" "default" {
  api_id      = aws_apigatewayv2_api.delivery_api.id
  name        = "$default"
  auto_deploy = true
}
resource "aws_apigatewayv2_stage" "dev" {
  api_id      = aws_apigatewayv2_api.delivery_api.id
  name        = local.apigateway.stage_name
  auto_deploy = true
}

I'm not sure how applicable this is in a module.

is it hard to set args(or fix the module configs) for creating above resources only? or it is not the purpose of this module?

github-actions[bot] commented 1 year ago

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[bot] commented 1 year ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 1 year ago

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.