pepperize / cdk-github Goto Github PK
View Code? Open in Web Editor NEWManage GitHub resources like repositories, teams, members, integrations and workflows with the AWS CDK as Custom Resources in CloudFormation.
License: MIT License
Manage GitHub resources like repositories, teams, members, integrations and workflows with the AWS CDK as Custom Resources in CloudFormation.
License: MIT License
Use type hinting from @types/aws-lambda
in the handler
The current implementation offers the ability to fully configure the GitHub AuthStrategies either by SecretsManager or SSM ParameterStore for GitHub App (with installationId), a PAT or unauthenticated
https://github.com/octokit/authentication-strategies.js/#authentication-strategiesjs
See also https://github.com/pepperize/cdk-github/blob/main/API.md#static-functions--1
auth strategy | description |
---|---|
appAuth | GitHub App or installation authentication. |
tokenAuth | Personal Access Token authentication. |
unauthenticated | unauthenticated. |
Do we have to support additional AuthStrategies. Or by different AWS Service i.e. AuthOptions.tokenAuthFromSecret(secret: ISecret)
, AuthOptions.tokenAuthFromParameter(parameter: IParameter)
Have for each construct at least a very simple test
For example matching a snapshot:
https://github.com/pepperize/cdk-github/blob/main/test/github-custom-resource.test.ts
describe("GithubCustomResource", () => {
it("Should match snapshot", () => {
// Given
const stack = new Stack();
new GithubCustomResource(stack, "CR", {
// ...
});
// When
const template = Template.fromStack(stack);
// Then
expect(template).toMatchSnapshot();
});
});
While using the list method the handler should use the paginator https://github.com/octokit/rest.js/
Document the decision for rest over requests
There are two ways of using the GitHub REST API, the octokit.rest.* endpoint methods and octokit.request. Both act the same way, the octokit.rest.* methods are just added for convenience, they use octokit.request internally.
https://github.com/octokit/octokit.js#rest-api
With https://github.com/octokit/plugin-rest-endpoint-methods.js/ one can send all the request parameters as a single object, no matter if it's a route, query or body parameter
To merge with https://github.com/WtfJoke/cdk-github we need to support the feature to https://docs.github.com/en/rest/actions/secrets#create-or-update-a-repository-secret
See:
A possible solution could be wrapping the SecretsManager Secrets or the SSM ParameterStore StringParameter by a class and using a symbol/identifier that can be used on JSON.parse in the lambda handler like PhysicalResourceIdReference
There are already Custom Resources in the public CloudFormation Registry cloudformation-github-resource-providers and cdk-cloudformation.
My understanding is they are complementary to our library. They are really good for regular use cases and can be used complementary with this custom construct.
This more flexible custom construct fills then the gap what is not implemented and also the ability to use a Github app or unauthenticated instead a PAT.
We may skip on higher constructs and refer to such libraries. Additional we can give some quickstart hint and an example for interop.
When I provide a custom PhysicalResourceId in the onCreate GithubApiCall, then maybe I want to reference it in the onUpdate GithubApiCall.
See https://github.com/pepperize/cdk-github/blob/main/API.md#physicalresourceidoptional-
This mimics the very same behavior of AWS CDK - custom_resources -PhysicalResourceIdReference
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.