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

Non-existent custom service endpoint definitions? #20823

Closed
lorengordon opened this issue Sep 7, 2021 · 4 comments · Fixed by #21641
Closed

Non-existent custom service endpoint definitions? #20823

lorengordon opened this issue Sep 7, 2021 · 4 comments · Fixed by #21641
Labels
bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS. service/codestarnotifications Issues and PRs that pertain to the codestarnotifications service.
Milestone

Comments

@lorengordon
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

❯ terraform version
Terraform v1.0.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.57.0

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

provider "aws" {
  endpoints {
    prometheusservice     = null
    codestarnotifications = null
  }
}

resource "aws_prometheus_workspace" "demo" {
  alias = "prometheus-test"
}

resource "aws_codecommit_repository" "code" {
  repository_name = "example-code-repo"
}

resource "aws_sns_topic" "notif" {
  name = "notification"
}

data "aws_iam_policy_document" "notif_access" {
  statement {
    actions = ["sns:Publish"]

    principals {
      type        = "Service"
      identifiers = ["codestar-notifications.amazonaws.com"]
    }

    resources = [aws_sns_topic.notif.arn]
  }
}

resource "aws_sns_topic_policy" "default" {
  arn    = aws_sns_topic.notif.arn
  policy = data.aws_iam_policy_document.notif_access.json
}

resource "aws_codestarnotifications_notification_rule" "commits" {
  detail_type    = "BASIC"
  event_type_ids = ["codecommit-repository-comments-on-commits"]

  name     = "example-code-repo-commits"
  resource = aws_codecommit_repository.code.arn

  target {
    address = aws_sns_topic.notif.arn
  }
}

Description of Bug

I was working on a config where every custom service endpoint is present in the provider config, using a map to lookup the FIPS endpoint, read from a file. If not present, the endpoint value is null to use the default. This works fine for every service except two: prometheusservice and codestarnotifications . For these two, I get an error that the "Argument named is not expected here."

Actual Behavior

❯ terraform plan
╷
│ Error: Unsupported argument
│
│   on main.tf line 3, in provider "aws":
│    3:     prometheusservice     = null
│
│ An argument named "prometheusservice" is not expected here.
╵
╷
│ Error: Unsupported argument
│
│   on main.tf line 4, in provider "aws":
│    4:     codestarnotifications = null
│
│ An argument named "codestarnotifications" is not expected here.
╵

Steps to Reproduce

  1. terraform plan
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/codecommit Issues and PRs that pertain to the codecommit service. service/codestarnotifications Issues and PRs that pertain to the codestarnotifications service. service/iam Issues and PRs that pertain to the iam service. service/prometheusservice service/sns Issues and PRs that pertain to the sns service. labels Sep 7, 2021
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS. and removed service/iam Issues and PRs that pertain to the iam service. service/sns Issues and PRs that pertain to the sns service. service/codecommit Issues and PRs that pertain to the codecommit service. needs-triage Waiting for first response or review from a maintainer. labels Sep 7, 2021
@ewbankkit
Copy link
Contributor

These 2 need to be added to EndpointServiceNames in internal/provider/provider.go.

@YakDriver
Copy link
Member

This is all moved now to internal/conns/conns.go and should be resolved soon.

@github-actions github-actions bot added this to the v3.65.0 milestone Nov 5, 2021
@YakDriver YakDriver modified the milestones: v3.65.0, v3.64.1 Nov 5, 2021
@github-actions
Copy link

github-actions bot commented Nov 5, 2021

This functionality has been released in v3.64.1 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@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 May 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS. service/codestarnotifications Issues and PRs that pertain to the codestarnotifications service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants