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

New datasouce: aws_codecommit_repository #4785

Closed
benfortuna opened this issue Jun 8, 2018 · 4 comments · Fixed by #4934
Closed

New datasouce: aws_codecommit_repository #4785

benfortuna opened this issue Jun 8, 2018 · 4 comments · Fixed by #4934
Labels
new-data-source Introduces a new data source. service/codecommit Issues and PRs that pertain to the codecommit service.
Milestone

Comments

@benfortuna
Copy link

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 "me too" comments, 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

Description

Currently Terraform doesn't support AWS CodeCommit as a datasource. Propose to support codecommit repository to retrieve info such as repo arn, clone url, repo name, etc.

New or Affected Resource(s)

  • aws_codecommit_repository (datasource only)

Potential Terraform Configuration

data "aws_codecommit_repository" "my_repo" {
  repository_name = "my_repo"
}

resource "aws_cloudwatch_event_rule" "myrepo_commit_event" {
  name = "myrepo-commit"
  event_pattern = <<EOF
{
  "source": [
    "aws.codecommit"
  ],
  "detail-type": [
    "CodeCommit Repository State Change"
  ],
  "resources": [
    "${data.aws_codecommit_repository.my_repo.arn}"
  ],
  "detail": {
    "event": [
      "referenceCreated",
      "referenceUpdated"
    ],
    "referenceType": [
      "branch"
    ],
    "referenceName": [
      "${var.branch}"
    ]
  }
}
EOF
}

resource "aws_codebuild_project" "my_project_build" {
  "artifacts" {
    type = "NO_ARTIFACTS"
  }
  "environment" {
    compute_type = "BUILD_GENERAL1_SMALL"
    image = "${var.codebuild_image}"
    type = "LINUX_CONTAINER"
  }
  name = "my-project-build"
  "source" {
    type     = "CODECOMMIT"
    location = "${data.aws_codecommit_repository.my_repo.clone_url_http}"
    buildspec = "codebuild/cloudformation/my-project-build.yml"
  }
  description  = "Build my project from my_repo"
  build_timeout = "5"
  service_role = "${data.aws_iam_role.my_build_role.arn}"
}

References

  • None.
@radeksimko radeksimko added new-data-source Introduces a new data source. service/codecommit Issues and PRs that pertain to the codecommit service. labels Jun 13, 2018
saravanan30erd added a commit to saravanan30erd/terraform-provider-aws that referenced this issue Jun 21, 2018
@saravanan30erd
Copy link
Contributor

Submitted PR: #4934

@bflad bflad added this to the v1.25.0 milestone Jun 22, 2018
@bflad
Copy link
Contributor

bflad commented Jun 22, 2018

The new aws_codecommit_repository data source has been merged into master and will release with version 1.25.0 of the AWS provider, likely middle of next week.

@bflad
Copy link
Contributor

bflad commented Jun 27, 2018

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

@ghost
Copy link

ghost commented Apr 5, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. service/codecommit Issues and PRs that pertain to the codecommit service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants