Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions client/src/pages/ConfigurePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ export default function ConfigurePage() {
</div>

{provider === "aws" && (
<>
<label className="grid gap-1">
<span className="text-sm font-medium">AWS Role (OIDC)</span>
<select
Expand All @@ -349,6 +350,28 @@ export default function ConfigurePage() {
the deploy job.
</span>
</label>
<label className="grid gap-1">
<span className="text-sm font-medium">AWS Role Session Name</span>
<input
disabled={busy}
value={options.awsSessionName ?? ""}
onChange={(e) => setOption("awsSessionName", e.target.value)}
className="rounded-md border border-white/25 px-3 py-2 text-sm font-mono text-white bg-white/10 placeholder-white/60 disabled:bg-white/5 disabled:text-slate-400"
placeholder="autodeploy"
/>
</label>

<label className="grid gap-1">
<span className="text-sm font-medium">AWS Region</span>
<input
disabled={busy}
value={options.awsRegion ?? ""}
onChange={(e) => setOption("awsRegion", e.target.value)}
className="rounded-md border border-white/25 px-3 py-2 text-sm font-mono text-white bg-white/10 placeholder-white/60 disabled:bg-white/5 disabled:text-slate-400"
placeholder="us-east-1"
/>
</label>
</>
)}

{provider === "gcp" && (
Expand Down
4 changes: 4 additions & 0 deletions client/src/store/usePipelineStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type PipelineState = {
testCmd: string;
buildCmd: string;
awsRoleArn?: string;
awsSessionName?: string;
awsRegion?: string;
gcpServiceAccountEmail?: string;
};
provider: "aws" | "gcp" | "jenkins";
Expand Down Expand Up @@ -72,6 +74,8 @@ const initial: PipelineState = {
installCmd: "npm ci",
testCmd: "npm test",
buildCmd: "npm run build",
awsSessionName: "autodeploy",
awsRegion: "us-east-1",
gcpServiceAccountEmail: "",
},
provider: "aws",
Expand Down
9 changes: 8 additions & 1 deletion server/tools/pipeline_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const pipeline_generator = {
testCmd: z.string().optional(),
buildCmd: z.string().optional(),
awsRoleArn: z.string().optional(),
awsSessionName: z.string().optional(),
awsRegion: z.string().optional(),
gcpServiceAccountEmail: z.string().optional(),
stages: z.array(z.enum(["build", "test", "deploy"])).optional(),
})
Expand All @@ -33,6 +35,8 @@ export const pipeline_generator = {
testCmd: options?.testCmd,
buildCmd: options?.buildCmd,
awsRoleArn: options?.awsRoleArn,
awsSessionName: options?.awsSessionName,
awsRegion: options?.awsRegion,
stages: options?.stages,
};

Expand Down Expand Up @@ -103,6 +107,8 @@ export const pipeline_generator = {
testCmd: options?.testCmd,
buildCmd: options?.buildCmd,
awsRoleArn: options?.awsRoleArn,
awsSessionName: options?.awsSessionName,
awsRegion: options?.awsRegion,
gcpServiceAccountEmail: options?.gcpServiceAccountEmail,
stages: options?.stages,
};
Expand Down Expand Up @@ -177,7 +183,8 @@ jobs:
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${normalized.awsRoleArn ?? "REPLACE_ME"}
aws-region: us-east-1
role-session-name: ${normalized.awsSessionName ?? "autodeploy"}
aws-region: ${normalized.awsRegion ?? "us-east-1"}
- name: Deploy Application
run: echo "Deploying ${repo} to AWS..."
`;
Expand Down
Loading