-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Ability to setup aws_codepipeline to use webhooks instead of polling. #4478
Comments
I think there is more to this than just adding the put/register webook capabilities to the provider. I thought I would be crafty and just use the stage {
name = "Source"
action {
name = "${local.src_action_name}"
category = "Source"
owner = "ThirdParty"
provider = "GitHub"
output_artifacts = ["gonzo-src"]
version = "1"
configuration {
Owner = "${local.github_owner}"
Repo = "${local.repo_name}"
Branch = "master"
OAuthToken = "${var.github_token}"
PollForSourceChanges = "false"
}
} Once my pipeline is created with Terraform I can go into the AWS CodePipeline console and see it has failed on sourcing my GitHub project. If I edit the source and click the Connect to GitHub button, go through the steps, select my repo and branch and save, it then starts working and I see the AWS CodePipeline (Oregon) entry show up under my Authorized OAuth Apps in GitHub. At this point I can go back to the aws console and run the exact same AWS CLI To summarize... I believe the I can tell you this... if you define your pipeline using JSON and create it using the AWS CLI create-pipeline command it in fact does successfully register AWS CodePipeline as an authorized OAuth application. |
I've started work on an You'd then use the webhook URL it returns along with the secret you create for it when creating a You might use it kind of like this: locals {
webhook_secret = "a09s8df7asd0f97" # Can be anything
}
resource "aws_codepipeline_webhook" "github_to_foo" {
name = "foo-pipeline-to-github"
auth {
type = "GITHUB_HMAC"
secret = "${local.webhook_secret}"
}
target {
action = "CodeCheckoutActionNameHere"
pipeline = "foo-pipeline"
}
}
resource "github_repository_webhook" "foo" {
repository = "${github_repository.repo.name}"
name = "web"
configuration {
url = "${aws_codepipeline_webhook.github_to_foo.url}"
secret = "${local.webhook_secret}"
}
} |
@joestump what is the status of this, It would be really nice to get it in so we can use webhooks now. |
@jwhitcraft the status is I need to get off my lazy butt and finish my PR already. 😄 |
We are anxiously awaiting this feature too. |
I've got a WIP PR pushed to #5875. Hoping to finish testing soon. |
I'm also very excited for this feature @joestump! I had to use |
Spent some time today cleaning up PR #5875. It should be ready for final review. |
The new |
This has been released in version 1.41.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
does
when i release on github the payload then is delivered to codepipeline_webhook but is not consumed and the pipeline not triggered |
could you please advice on that ⬆️ |
I tested this live with the |
sorry i already tried |
what is the difference when you want to use for an Organization ?? when i am use OAuthToken is working fine aws_codepipeline.mypipeline: [ERROR] Error updating CodePipeline (codepipeline-dev-Terraform-development): InvalidActionDeclarationException: Action configuration for action 'Source' is missing required configuration 'OAuthToken'
|
There's a caveat when using the GitHub provider where you have to specify
the token to authenticate via a GITHUB_TOKEN environment variable. See the
top of the docs here:
https://www.terraform.io/docs/providers/aws/r/codepipeline.html
…On Mon, Nov 12, 2018, 9:49 AM michaelm88 ***@***.*** wrote:
what is the difference when you want to use for an Organization ??
as we can not use webhook_secret ??
could you help me please with that
when i am use OAuthToken is working fine
aws_codepipeline.mypipeline: [ERROR] Error updating CodePipeline
(codepipeline-dev-Terraform-development):
InvalidActionDeclarationException: Action configuration for action 'Source'
is missing required configuration 'OAuthToken'
- github_repository_webhook.bar: POST
https://api.github.com/repos********/hooks: 401 Bad credentials
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4478 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATKmd2vIu8b5up1-6BRLUhKNtodT06Zks5uubSsgaJpZM4T2nhV>
.
|
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! |
Community Note
Description
Support the new feature on aws_codepipeline of allowing webhooks to trigger the pipeline instead of polling github.
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: