-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
72 lines (68 loc) · 1.99 KB
/
template.yml
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
66
67
68
69
70
71
72
AWSTemplateFormatVersion: '2010-09-09'
Description: 'AWS CloudFormation Template for Sandbox CodeBuild Project'
Parameters:
ProjectName:
Type: String
Default: codebuild-sandbox
Description: Name of the CodeBuild project.
BuildImage:
Type: String
Default: AL2.x86-64.Standard.5.0
Description: The build image for the project.
AllowedValues:
- AL2.x86-64.Standard.5.0
- Ubuntu.x86-64.7.0
- AL2.arm64.Standard.3.0
ComputeType:
Type: String
Default: BUILD_GENERAL1_SMALL
Description: The compute type for the project.
AllowedValues:
- BUILD_GENERAL1_SMALL
- BUILD_GENERAL1_MEDIUM
- BUILD_GENERAL1_LARGE
Mappings:
Environment:
AL2.x86-64.Standard.5.0:
Type: LINUX_CONTAINER
BuildImage: aws/codebuild/amazonlinux2-x86_64-standard:5.0
Ubuntu.x86-64.7.0:
Type: LINUX_CONTAINER
BuildImage: aws/codebuild/standard:7.0
AL2.arm64.Standard.3.0:
Type: ARM_CONTAINER
BuildImage: aws/codebuild/amazonlinux2-aarch64-standard:3.0
Resources:
CodeBuildServiceRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: codebuild.amazonaws.com
Action: sts:AssumeRole
Path: /service-role/
ManagedPolicyArns:
- arn:aws:iam::aws:policy/PowerUserAccess
CodeBuildProject:
Type: AWS::CodeBuild::Project
Properties:
Name: !Ref ProjectName
ServiceRole: !GetAtt CodeBuildServiceRole.Arn
Artifacts:
Type: NO_ARTIFACTS
Source:
Type: NO_SOURCE
BuildSpec: |
version: 0.2
phases:
build:
commands:
- codebuild-breakpoint
Environment:
Type: !FindInMap [Environment, !Ref BuildImage, Type]
Image: !FindInMap [Environment, !Ref BuildImage, BuildImage]
ComputeType: !Ref ComputeType
PrivilegedMode: true