| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
new GithubCustomResource(scope, "GithubRepo", {
onCreate: {
// https://octokit.github.io/rest.js/v19/#repos-create-in-org
endpoint: "repos",
method: "createInOrg",
parameters: {
org: "pepperize",
name: "cdk-github",
},
outputPaths: ["id", "full_name"],
physicalResourceId: custom_resources.PhysicalResourceId.fromResponse("full_name"),
ignoreErrorCodesMatching: "name already exists on this account",
},
onUpdate: {
// https://octokit.github.io/rest.js/v19#repos-get
endpoint: "repos",
method: "get",
parameters: {
owner: "pepperize",
repo: "cdk-github",
},
outputPaths: ["id", "full_name"],
physicalResourceId: custom_resources.PhysicalResourceId.fromResponse("full_name"),
},
onDelete: {
// https://octokit.github.io/rest.js/v19#repos-delete
endpoint: "repos",
method: "delete",
parameters: {
owner: "pepperize",
repo: "cdk-github",
},
outputPaths: [],
},
authOptions: AuthOptions.appAuth(auth),
});import { GithubCustomResource } from '@pepperize/cdk-github'
new GithubCustomResource(scope: Construct, id: string, props: GithubCustomResourceProps)| Name | Type | Description |
|---|---|---|
| scope | constructs.Construct | No description. |
| id | string | No description. |
| props | GithubCustomResourceProps | No description. |
| Name | Description |
|---|---|
| toString | Returns a string representation of this construct. |
| getAtt | Returns the value of an attribute of the custom resource of an arbitrary type. |
| getAttString | Returns the value of an attribute of the custom resource of type string. |
public toString(): stringReturns a string representation of this construct.
public getAtt(attributeName: string): ReferenceReturns the value of an attribute of the custom resource of an arbitrary type.
Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.
the name of the attribute.
public getAttString(attributeName: string): stringReturns the value of an attribute of the custom resource of type string.
Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.
the name of the attribute.
| Name | Description |
|---|---|
| isConstruct | Checks if x is a construct. |
import { GithubCustomResource } from '@pepperize/cdk-github'
GithubCustomResource.isConstruct(x: any)Checks if x is a construct.
Any object.
| Name | Type | Description |
|---|---|---|
| node | constructs.Node | The tree node. |
| ref | string | The physical name of this custom resource. |
public readonly node: Node;The tree node.
public readonly ref: string;The physical name of this custom resource.
import { GithubCustomResourceBase } from '@pepperize/cdk-github'
new GithubCustomResourceBase(scope: Construct, id: string)| Name | Type | Description |
|---|---|---|
| scope | constructs.Construct | The scope in which to define this construct. |
| id | string | The scoped construct ID. |
The scope in which to define this construct.
The scoped construct ID.
Must be unique amongst siblings. If the ID includes a path separator (/), then it will be replaced by double dash --.
| Name | Description |
|---|---|
| toString | Returns a string representation of this construct. |
| getAtt | Returns the value of an attribute of the custom resource of an arbitrary type. |
| getAttString | Returns the value of an attribute of the custom resource of type string. |
public toString(): stringReturns a string representation of this construct.
public getAtt(attributeName: string): ReferenceReturns the value of an attribute of the custom resource of an arbitrary type.
Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.
the name of the attribute.
public getAttString(attributeName: string): stringReturns the value of an attribute of the custom resource of type string.
Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.
the name of the attribute.
| Name | Description |
|---|---|
| isConstruct | Checks if x is a construct. |
import { GithubCustomResourceBase } from '@pepperize/cdk-github'
GithubCustomResourceBase.isConstruct(x: any)Checks if x is a construct.
Any object.
| Name | Type | Description |
|---|---|---|
| node | constructs.Node | The tree node. |
| ref | string | The physical name of this custom resource. |
public readonly node: Node;The tree node.
public readonly ref: string;The physical name of this custom resource.
import { GithubApiCall } from '@pepperize/cdk-github'
const githubApiCall: GithubApiCall = { ... }| Name | Type | Description |
|---|---|---|
| endpoint | string | The endpoint to call. |
| method | string | The method to call. |
| ignoreErrorCodesMatching | string | The regex pattern to use to catch API errors. |
| outputPaths | string[] | Filter the data returned by the custom resource to specific paths in the API response. |
| parameters | any | The parameters for the service action. |
| physicalResourceId | aws-cdk-lib.custom_resources.PhysicalResourceId | The physical resource id of the custom resource for this call. |
public readonly endpoint: string;The endpoint to call.
public readonly method: string;The method to call.
public readonly ignoreErrorCodesMatching: string;The regex pattern to use to catch API errors.
The message property of the RequestError object will be tested against this pattern. If there is a match an error will not be thrown.
public readonly outputPaths: string[];Filter the data returned by the custom resource to specific paths in the API response.
The total size of the response body can't exceed 4096 bytes.
Example for octokit.rest.repos.createInOrg: ['id', 'full_name', 'owner.id']](https://docs.github.com/en/rest
Example for octokit.rest.repos.createInOrg: ['id', 'full_name', 'owner.id'])
public readonly parameters: any;The parameters for the service action.
public readonly physicalResourceId: PhysicalResourceId;The physical resource id of the custom resource for this call.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
import { GithubCustomResourceOptions } from '@pepperize/cdk-github'
const githubCustomResourceOptions: GithubCustomResourceOptions = { ... }| Name | Type | Description |
|---|---|---|
| authOptions | IAuthOptions | Currently, supports only GitHub App. |
public readonly authOptions: IAuthOptions;Currently, supports only GitHub App.
const auth = { appId, privateKey };
const installationAuth = { appId, privateKey, installationId };https://github.com/octokit/authentication-strategies.js/#github-app-or-installation-authentication
import { GithubCustomResourceProps } from '@pepperize/cdk-github'
const githubCustomResourceProps: GithubCustomResourceProps = { ... }| Name | Type | Description |
|---|---|---|
| authOptions | IAuthOptions | Currently, supports only GitHub App. |
| onCreate | GithubApiCall | The GitHub Api call to make when the resource is created. |
| onDelete | GithubApiCall | The GitHub Api call to make when the resource is deleted. |
| onUpdate | GithubApiCall | The GitHub Api call to make when the resource is updated. |
| resourceType | string | Cloudformation Resource type. |
public readonly authOptions: IAuthOptions;Currently, supports only GitHub App.
const auth = { appId, privateKey };
const installationAuth = { appId, privateKey, installationId };https://github.com/octokit/authentication-strategies.js/#github-app-or-installation-authentication
public readonly onCreate: GithubApiCall;The GitHub Api call to make when the resource is created.
public readonly onDelete: GithubApiCall;The GitHub Api call to make when the resource is deleted.
public readonly onUpdate: GithubApiCall;The GitHub Api call to make when the resource is updated.
public readonly resourceType: string;Cloudformation Resource type.
import { AuthOptions } from '@pepperize/cdk-github'
new AuthOptions()| Name | Type | Description |
|---|
| Name | Description |
|---|---|
| appAuth | GitHub App or installation authentication. |
| tokenAuth | Personal Access Token authentication. |
| unauthenticated | unauthenticated. |
import { AuthOptions } from '@pepperize/cdk-github'
AuthOptions.appAuth(secret: ISecret)GitHub App or installation authentication.
import { AuthOptions } from '@pepperize/cdk-github'
AuthOptions.tokenAuth(parameter: IParameter)Personal Access Token authentication.
import { AuthOptions } from '@pepperize/cdk-github'
AuthOptions.unauthenticated()unauthenticated.
| Back | FazBrowse Home | New Git URL |