forked from aws/aws-lambda-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.ps1
More file actions
65 lines (46 loc) · 2.61 KB
/
bootstrap.ps1
File metadata and controls
65 lines (46 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
param (
[Parameter(Mandatory = $true, HelpMessage = "Pipeline Account ID.")]
[string] $PipelineAccountId,
[Parameter(Mandatory = $false, HelpMessage = "Pipeline name suffix.")]
[string] $PipelineNameSuffix,
[Parameter(Mandatory = $true, HelpMessage = "Region.")]
[string] $Region,
[Parameter(Mandatory = $true, HelpMessage = "The name of the secret in Secret Manager that contains the GitHub Access Token.")]
[string] $GitHubTokenSecretName,
[Parameter(Mandatory = $true, HelpMessage = "The secret key in Secret Manager that contains the GitHub Access Token.")]
[string] $GitHubTokenSecretKey,
[Parameter(Mandatory = $true, HelpMessage = "GitHub repository owner name.")]
[string] $GitHubRepoOwner,
[Parameter(Mandatory = $true, HelpMessage = "GitHub repository name.")]
[string] $GitHubRepoName,
[Parameter(Mandatory = $true, HelpMessage = "GitHub repository branch name.")]
[string] $GitHubRepoBranch,
[Parameter(Mandatory = $true, HelpMessage = "GitHub staging repository owner name.")]
[string] $GitHubRepoOwnerStaging,
[Parameter(Mandatory = $true, HelpMessage = "GitHub staging repository name.")]
[string] $GitHubRepoNameStaging,
[Parameter(Mandatory = $true, HelpMessage = "GitHub staging repository branch name.")]
[string] $GitHubRepoBranchStaging,
[Parameter(Mandatory = $false, HelpMessage = "ECR URI to store Stage images.")]
[string] $StageEcr,
[Parameter(Mandatory = $false, HelpMessage = "Semicolon separated ECR URIs to store Beta images.")]
[string] $BetaEcrs,
[Parameter(Mandatory = $false, HelpMessage = "Semicolon separated ECR URIs to store Prod images.")]
[string] $ProdEcrs
)
$env:AWS_LAMBDA_PIPELINE_ACCOUNT_ID = $PipelineAccountId
$env:AWS_LAMBDA_PIPELINE_REGION = $Region
$env:AWS_LAMBDA_PIPELINE_NAME_SUFFIX = $PipelineNameSuffix
$env:AWS_LAMBDA_GITHUB_TOKEN_SECRET_NAME = $GitHubTokenSecretName
$env:AWS_LAMBDA_GITHUB_TOKEN_SECRET_KEY = $GitHubTokenSecretKey
$env:AWS_LAMBDA_GITHUB_REPO_OWNER = $GitHubRepoOwner
$env:AWS_LAMBDA_GITHUB_REPO_NAME = $GitHubRepoName
$env:AWS_LAMBDA_GITHUB_REPO_BRANCH = $GitHubRepoBranch
$env:AWS_LAMBDA_GITHUB_REPO_OWNER_STAGING = $GitHubRepoOwnerStaging
$env:AWS_LAMBDA_GITHUB_REPO_NAME_STAGING = $GitHubRepoNameStaging
$env:AWS_LAMBDA_GITHUB_REPO_BRANCH_STAGING = $GitHubRepoBranchStaging
$env:AWS_LAMBDA_STAGE_ECR = $StageEcr
$env:AWS_LAMBDA_BETA_ECRS = $BetaEcrs
$env:AWS_LAMBDA_PROD_ECRS = $ProdEcrs
npx cdk bootstrap --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess aws://$PipelineAccountId/$Region
npx cdk deploy --require-approval never --all