Neel
04/24/2022, 12:35 AMversions_pipeline.addStage({
stageName: "PipelineUpdate",
actions: [
new CloudFormationCreateUpdateStackAction({
actionName: "PipelineUpdate",
stackName: "PipelineStack",
templatePath: buildOutput.atPath(
"cdk-my-sst-app-versions-pipeline.template.json"
),
adminPermissions: true,
}),
],
});
I am following a aws-cdk infra tutorial and trying it on SST. The below line is giving error.
templatePath: buildOutput.atPath(
"cdk-my-sst-app-versions-pipeline.template.json"
),
I guess buildOutput.atPath looks into my buildArtifact and it tries to findout my template.json. But the folderstructure is different from aws-cdk. I am not sure if I am right in saying this. The below is the error.
File [cdk-my-sst-app-versions-pipeline.template.json] does not exist in artifact [VersionBuild]
Thanks for the help. Below is my whole PipeLineStack that I am creating. I am failing at third stage (PipelineUpdate).
import { App, Stack, StackProps } from "@serverless-stack/resources";
import { SecretValue } from "aws-cdk-lib";
import {
BuildSpec,
LinuxBuildImage,
PipelineProject,
} from "aws-cdk-lib/aws-codebuild";
import { Artifact, Pipeline } from "aws-cdk-lib/aws-codepipeline";
import {
CloudFormationCreateUpdateStackAction,
CodeBuildAction,
GitHubSourceAction,
} from "aws-cdk-lib/aws-codepipeline-actions";
export class PipelineStack extends Stack {
constructor(scope: App, id: string, props: StackProps) {
super(scope, id, props);
const versions_pipeline = new Pipeline(this, "VersionsPipeline", {
pipelineName: "VersionPipeline",
crossAccountKeys: false,
});
const sourceOutput = new Artifact("VersionsSource");
versions_pipeline.addStage({
stageName: "Source",
actions: [
new GitHubSourceAction({
owner: "my-git-username",
repo: "my-git-repo",
branch: "main",
actionName: "PipelineSource",
oauthToken: SecretValue.secretsManager("github-pipeline-secret"),
output: sourceOutput,
}),
],
});
const buildOutput = new Artifact("VersionBuild");
versions_pipeline.addStage({
stageName: "VersionBuild",
actions: [
new CodeBuildAction({
actionName: "VersionBuild",
input: sourceOutput,
outputs: [buildOutput],
project: new PipelineProject(this, "VersionBuildProject", {
environment: {
buildImage: LinuxBuildImage.STANDARD_5_0,
},
buildSpec: BuildSpec.fromSourceFilename("versions-build-spec.yml"),
}),
}),
],
});
versions_pipeline.addStage({
stageName: "PipelineUpdate",
actions: [
new CloudFormationCreateUpdateStackAction({
actionName: "PipelineUpdate",
stackName: "PipelineStack",
templatePath: buildOutput.atPath(
"cdk-my-sst-app-versions-pipeline.template.json"
),
adminPermissions: true,
}),
],
});
}
}
Frank
Frank
.build/cdk.out
. Are you able to point it there?Neel
06/17/2022, 10:56 AM.build/cdk.out
But I wasn't able to point it there. For some reason, it wasn't automatically working for me. We moved to GitHub actions for now.Neel
06/17/2022, 10:56 AM