openapi: 3.0.0 info: version: '2016-10-06' x-release: v4 title: 'AWS CodeBuild Builds #X Amz Target=CodeBuild 20161006.CreateWebhook API' description: CodeBuild

CodeBuild is a fully managed build service in the cloud. CodeBuild compiles your source code, runs unit tests, and produces artifacts that are ready to deploy. CodeBuild eliminates the need to provision, manage, and scale your own build servers. It provides prepackaged build environments for the most popular programming languages and build tools, such as Apache Maven, Gradle, and more. You can also fully customize build environments in CodeBuild to use your own build tools. CodeBuild scales automatically to meet peak build requests. You pay only for the build time you consume. For more information about CodeBuild, see the CodeBuild User Guide.

x-logo: url: https://twitter.com/awscloud/profile_image?size=original backgroundColor: '#FFFFFF' termsOfService: https://aws.amazon.com/service-terms/ contact: name: Mike Ralphson email: mike.ralphson@gmail.com url: https://github.com/mermade/aws2openapi x-twitter: PermittedSoc license: name: Apache 2.0 License url: http://www.apache.org/licenses/ x-providerName: amazonaws.com x-serviceName: codebuild x-origin: - contentType: application/json url: https://raw.githubusercontent.com/aws/aws-sdk-js/master/apis/codebuild-2016-10-06.normal.json converter: url: https://github.com/mermade/aws2openapi version: 1.0.0 x-apisguru-driver: external x-apiClientRegistration: url: https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc2=h_ct x-apisguru-categories: - cloud x-preferred: true servers: - url: http://codebuild.{region}.amazonaws.com variables: region: description: The AWS region enum: - us-east-1 - us-east-2 - us-west-1 - us-west-2 - us-gov-west-1 - us-gov-east-1 - ca-central-1 - eu-north-1 - eu-west-1 - eu-west-2 - eu-west-3 - eu-central-1 - eu-south-1 - af-south-1 - ap-northeast-1 - ap-northeast-2 - ap-northeast-3 - ap-southeast-1 - ap-southeast-2 - ap-east-1 - ap-south-1 - sa-east-1 - me-south-1 default: us-east-1 description: The AWS CodeBuild multi-region endpoint - url: https://codebuild.{region}.amazonaws.com variables: region: description: The AWS region enum: - us-east-1 - us-east-2 - us-west-1 - us-west-2 - us-gov-west-1 - us-gov-east-1 - ca-central-1 - eu-north-1 - eu-west-1 - eu-west-2 - eu-west-3 - eu-central-1 - eu-south-1 - af-south-1 - ap-northeast-1 - ap-northeast-2 - ap-northeast-3 - ap-southeast-1 - ap-southeast-2 - ap-east-1 - ap-south-1 - sa-east-1 - me-south-1 default: us-east-1 description: The AWS CodeBuild multi-region endpoint - url: http://codebuild.{region}.amazonaws.com.cn variables: region: description: The AWS region enum: - cn-north-1 - cn-northwest-1 default: cn-north-1 description: The AWS CodeBuild endpoint for China (Beijing) and China (Ningxia) - url: https://codebuild.{region}.amazonaws.com.cn variables: region: description: The AWS region enum: - cn-north-1 - cn-northwest-1 default: cn-north-1 description: The AWS CodeBuild endpoint for China (Beijing) and China (Ningxia) security: - hmac: [] tags: - name: '#X Amz Target=CodeBuild 20161006.CreateWebhook' paths: /#X-Amz-Target=CodeBuild_20161006.CreateWebhook: parameters: - $ref: '#/components/parameters/X-Amz-Content-Sha256' - $ref: '#/components/parameters/X-Amz-Date' - $ref: '#/components/parameters/X-Amz-Algorithm' - $ref: '#/components/parameters/X-Amz-Credential' - $ref: '#/components/parameters/X-Amz-Security-Token' - $ref: '#/components/parameters/X-Amz-Signature' - $ref: '#/components/parameters/X-Amz-SignedHeaders' post: operationId: CreateWebhook description:

For an existing CodeBuild build project that has its source code stored in a GitHub or Bitbucket repository, enables CodeBuild to start rebuilding the source code every time a code change is pushed to the repository.

If you enable webhooks for an CodeBuild project, and the project is used as a build step in CodePipeline, then two identical builds are created for each commit. One build is triggered through webhooks, and one through CodePipeline. Because billing is on a per-build basis, you are billed for both builds. Therefore, if you are using CodePipeline, we recommend that you disable webhooks in CodeBuild. In the CodeBuild console, clear the Webhook box. For more information, see step 5 in Change a Build Project's Settings.

responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/CreateWebhookOutput' examples: CreateWebhook200Example: summary: Default CreateWebhook 200 response x-microcks-default: true value: webhook: example-value '480': description: InvalidInputException content: application/json: schema: $ref: '#/components/schemas/InvalidInputException' examples: CreateWebhook480Example: summary: Default CreateWebhook 480 response x-microcks-default: true value: example-value '481': description: OAuthProviderException content: application/json: schema: $ref: '#/components/schemas/OAuthProviderException' examples: CreateWebhook481Example: summary: Default CreateWebhook 481 response x-microcks-default: true value: example-value '482': description: ResourceAlreadyExistsException content: application/json: schema: $ref: '#/components/schemas/ResourceAlreadyExistsException' examples: CreateWebhook482Example: summary: Default CreateWebhook 482 response x-microcks-default: true value: example-value '483': description: ResourceNotFoundException content: application/json: schema: $ref: '#/components/schemas/ResourceNotFoundException' examples: CreateWebhook483Example: summary: Default CreateWebhook 483 response x-microcks-default: true value: example-value requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateWebhookInput' examples: CreateWebhookRequestExample: summary: Default CreateWebhook request x-microcks-default: true value: projectName: example-resource branchFilter: example-value filterGroups: example-value buildType: STANDARD parameters: - name: X-Amz-Target in: header required: true schema: type: string enum: - CodeBuild_20161006.CreateWebhook summary: Amazon CodeBuild Create Webhook x-microcks-operation: delay: 0 dispatcher: FALLBACK tags: - '#X Amz Target=CodeBuild 20161006.CreateWebhook' components: parameters: X-Amz-Content-Sha256: name: X-Amz-Content-Sha256 in: header schema: type: string required: false X-Amz-Algorithm: name: X-Amz-Algorithm in: header schema: type: string required: false X-Amz-Credential: name: X-Amz-Credential in: header schema: type: string required: false X-Amz-Security-Token: name: X-Amz-Security-Token in: header schema: type: string required: false X-Amz-Signature: name: X-Amz-Signature in: header schema: type: string required: false X-Amz-Date: name: X-Amz-Date in: header schema: type: string required: false X-Amz-SignedHeaders: name: X-Amz-SignedHeaders in: header schema: type: string required: false schemas: ResourceNotFoundException: {} WebhookBuildType: type: string enum: - BUILD - BUILD_BATCH WebhookFilterType: type: string enum: - EVENT - BASE_REF - HEAD_REF - ACTOR_ACCOUNT_ID - FILE_PATH - COMMIT_MESSAGE WebhookFilter: type: object required: - type - pattern properties: type: allOf: - $ref: '#/components/schemas/WebhookFilterType' - description: '

The type of webhook filter. There are six webhook filter types: EVENT, ACTOR_ACCOUNT_ID, HEAD_REF, BASE_REF, FILE_PATH, and COMMIT_MESSAGE.

EVENT

A webhook event triggers a build when the provided pattern matches one of five event types: PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED, PULL_REQUEST_REOPENED, and PULL_REQUEST_MERGED. The EVENT patterns are specified as a comma-separated string. For example, PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED filters all push, pull request created, and pull request updated events.

The PULL_REQUEST_REOPENED works with GitHub and GitHub Enterprise only.

ACTOR_ACCOUNT_ID

A webhook event triggers a build when a GitHub, GitHub Enterprise, or Bitbucket account ID matches the regular expression pattern.

HEAD_REF

A webhook event triggers a build when the head reference matches the regular expression pattern. For example, refs/heads/branch-name and refs/tags/tag-name.

Works with GitHub and GitHub Enterprise push, GitHub and GitHub Enterprise pull request, Bitbucket push, and Bitbucket pull request events.

BASE_REF

A webhook event triggers a build when the base reference matches the regular expression pattern. For example, refs/heads/branch-name.

Works with pull request events only.

FILE_PATH

A webhook triggers a build when the path of a changed file matches the regular expression pattern.

Works with GitHub and Bitbucket events push and pull requests events. Also works with GitHub Enterprise push events, but does not work with GitHub Enterprise pull request events.

COMMIT_MESSAGE

A webhook triggers a build when the head commit message matches the regular expression pattern.

Works with GitHub and Bitbucket events push and pull requests events. Also works with GitHub Enterprise push events, but does not work with GitHub Enterprise pull request events.

' pattern: allOf: - $ref: '#/components/schemas/String' - description:

For a WebHookFilter that uses EVENT type, a comma-separated string that specifies one or more events. For example, the webhook filter PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED allows all push, pull request created, and pull request updated events to trigger a build.

For a WebHookFilter that uses any of the other filter types, a regular expression pattern. For example, a WebHookFilter that uses HEAD_REF for its type and the pattern ^refs/heads/ triggers a build when the head reference is a branch with a reference name refs/heads/branch-name.

excludeMatchedPattern: allOf: - $ref: '#/components/schemas/WrapperBoolean' - description: ' Used to indicate that the pattern determines which webhook events do not trigger a build. If true, then a webhook event that does not match the pattern triggers a build. If false, then a webhook event that matches the pattern triggers a build. ' description: ' A filter used to determine which webhooks trigger a build. ' NonEmptyString: type: string minLength: 1 WrapperBoolean: type: boolean Timestamp: type: string format: date-time CreateWebhookInput: type: object required: - projectName title: CreateWebhookInput properties: projectName: allOf: - $ref: '#/components/schemas/ProjectName' - description: The name of the CodeBuild project. branchFilter: allOf: - $ref: '#/components/schemas/String' - description:

A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If branchFilter is empty, then all branches are built.

It is recommended that you use filterGroups instead of branchFilter.

filterGroups: allOf: - $ref: '#/components/schemas/FilterGroups' - description:

An array of arrays of WebhookFilter objects used to determine which webhooks are triggered. At least one WebhookFilter in the array must specify EVENT as its type.

For a build to be triggered, at least one filter group in the filterGroups array must pass. For a filter group to pass, each of its filters must pass.

buildType: allOf: - $ref: '#/components/schemas/WebhookBuildType' - description: Specifies the type of build this webhook will trigger. FilterGroup: type: array items: $ref: '#/components/schemas/WebhookFilter' ResourceAlreadyExistsException: {} String: type: string CreateWebhookOutput: type: object properties: webhook: allOf: - $ref: '#/components/schemas/Webhook' - description: Information about a webhook that connects repository events to a build project in CodeBuild. Webhook: type: object properties: url: allOf: - $ref: '#/components/schemas/NonEmptyString' - description: The URL to the webhook. payloadUrl: allOf: - $ref: '#/components/schemas/NonEmptyString' - description: The CodeBuild endpoint where webhook events are sent. secret: allOf: - $ref: '#/components/schemas/NonEmptyString' - description:

The secret token of the associated repository.

A Bitbucket webhook does not support secret.

branchFilter: allOf: - $ref: '#/components/schemas/String' - description:

A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If branchFilter is empty, then all branches are built.

It is recommended that you use filterGroups instead of branchFilter.

filterGroups: allOf: - $ref: '#/components/schemas/FilterGroups' - description:

An array of arrays of WebhookFilter objects used to determine which webhooks are triggered. At least one WebhookFilter in the array must specify EVENT as its type.

For a build to be triggered, at least one filter group in the filterGroups array must pass. For a filter group to pass, each of its filters must pass.

buildType: allOf: - $ref: '#/components/schemas/WebhookBuildType' - description: Specifies the type of build this webhook will trigger. lastModifiedSecret: allOf: - $ref: '#/components/schemas/Timestamp' - description: 'A timestamp that indicates the last time a repository''s secret token was modified. ' description: Information about a webhook that connects repository events to a build project in CodeBuild. ProjectName: type: string pattern: '[A-Za-z0-9][A-Za-z0-9\-_]{1,254}' minLength: 2 maxLength: 255 OAuthProviderException: {} InvalidInputException: {} FilterGroups: type: array items: $ref: '#/components/schemas/FilterGroup' securitySchemes: hmac: type: apiKey name: Authorization in: header description: Amazon Signature authorization v4 x-amazon-apigateway-authtype: awsSigv4 externalDocs: description: Amazon Web Services documentation url: https://docs.aws.amazon.com/codebuild/ x-hasEquivalentPaths: true