Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public constructor(parent: App, name: string, props?: StackProps) {
super(parent, name, props);
const repository = new Repository(this, 'Repository', {
repositoryName: 'MyRepositoryName',
description: 'Some description.', // optional property
});
const sourceArtifact = new Artifact();
const sourceAction = new CodeCommitSourceAction({
actionName: 'CodeCommit',
repository,
output: sourceArtifact,
branch: 'master',
});
const checkAction = new CodepipelineCheckParameterAction({
actionName: 'Check',
parameterName: '/test',
regExp: /^The.*Spain$/,
logParameter: true,
});
new Pipeline(this, 'MyPipeline', {
pipelineName: 'MyPipeline',
stages: [
});
const sourceOutputEcr = new codepipeline.Artifact();
const sourceOutputCodeCommit = new codepipeline.Artifact();
const sourceActionECR = new codepipeline_actions.EcrSourceAction({
actionName: 'ECR',
repository: this.ecrRepository,
imageTag: 'latest', // optional, default: 'latest'
output: sourceOutputEcr,
});
const codecommitRepo = new codecommit.Repository(this, 'GitRepo', {
repositoryName: CODECOMMIT_REPO_NAME
});
const sourceActionCodeCommit = new codepipeline_actions.CodeCommitSourceAction({
actionName: 'CodeCommit',
// repository: codecommit.Repository.fromRepositoryName(this, 'GitRepo', CODECOMMIT_REPO_NAME),
repository: codecommitRepo,
output: sourceOutputCodeCommit,
});
codePipeline.addStage({
stageName: 'Source',
actions: [sourceActionCodeCommit, sourceActionECR],
});
codePipeline.addStage({
stageName: 'Deploy',
actions: [
new codepipeline_actions.EcsDeployAction({
actionName: 'DeployAction',
public constructor(parent: App, name: string, props?: StackProps) {
super(parent, name, props);
const repository = new Repository(this, 'Repository', {
repositoryName: 'MyRepositoryName',
description: 'Some description.', // optional property
});
const sourceArtifact = new Artifact();
const sourceAction = new CodeCommitSourceAction({
actionName: 'CodeCommit',
repository,
output: sourceArtifact,
});
const project = new PipelineProject(this, 'MyProject');
const buildAction = new CodeBuildAction({
actionName: 'CodeBuild',
project,
input: sourceArtifact,
});
const slackBotToken = process.env.SLACK_BOT_TOKEN as string;
const slackSigningSecret = process.env.SLACK_SIGNING_SECRET as string;
const slackChannel = process.env.SLACK_CHANNEL as string;