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

[Bug]: aws_iam_service_specific_credential password git credentials #38954

Open
sergio1986bcn opened this issue Aug 21, 2024 · 2 comments
Open
Labels
bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. service/iam Issues and PRs that pertain to the iam service. waiting-response Maintainers are waiting on response from community or contributor.

Comments

@sergio1986bcn
Copy link

sergio1986bcn commented Aug 21, 2024

Terraform Core Version

1.9.5

AWS Provider Version

5.63.1,5.62.0

Affected Resource(s)

aws_iam_service_specific_credential

Expected Behavior

The password generated by the aws_iam_service_specific_credential resource should be valid and not contain unexpected special characters, such as the # character

The password should be directly usable for authentication to AWS CodeCommit, without the need to remove additional characters or make modifications.

Actual Behavior

Instead of generating a password that can be used directly without modification, the aws_iam_service_specific_credential resource is generating a password that includes a trailing # character and affects authentication to AWS CodeCommit.

image

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = " 5.63.1"
    }
  }
}

provider "aws" {
  region  = "eu-west-1"
}

resource "aws_iam_user" "codecommit" {
  name = "git-codecommit"
}

resource "aws_iam_service_specific_credential" "codecommit" {
  service_name = "codecommit.amazonaws.com"
  user_name    = aws_iam_user.codecommit.name

  depends_on = [aws_iam_user.codecommit]
}

output "test" {
  sensitive = true
  value = aws_iam_service_specific_credential.codecommit.service_password
}

Steps to Reproduce

terraform init
terraform apply
terraform output -raw test

Debug Output

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@sergio1986bcn sergio1986bcn added the bug Addresses a defect in current functionality. label Aug 21, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/iam Issues and PRs that pertain to the iam service. label Aug 21, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 21, 2024
@justinretzolk
Copy link
Member

Hey @sergio1986bcn 👋 Thank you for taking the time to raise this! I took a look at the resource schema, and it appears the resource is returning exactly what the API returns.

I noticed that you're using the -raw flag for terraform output. Is it possible that what you're seeing is a # being printed due to there not being a newline at the end of the returned string? For example, with the following configuration:

resource "random_pet" "test" {}

output "test" {
  value = random_pet.test.id
}

I have the following results:

$ terraform output
test = "upward-flounder"

$ terraform output -raw test
upward-flounder%

$ terraform output test
"upward-flounder"

$ terraform output -json test | jq -r '.'
upward-flounder

@justinretzolk justinretzolk added the waiting-response Maintainers are waiting on response from community or contributor. label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. service/iam Issues and PRs that pertain to the iam service. waiting-response Maintainers are waiting on response from community or contributor.
Projects
None yet
Development

No branches or pull requests

2 participants