Skip to content

Commit d3c3b17

Browse files
authored
feat(superchain): add Amazon SSM agent (#3819)
Add the Amazon SSM agent to our image, so that we will be able to debug builds using the CodeBuild `<->` SSM breakpoint feature. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
1 parent e9d4084 commit d3c3b17

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

jest.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const config = {
3535
// quickly run out of control, and make everything very, very slow.)
3636
maxConcurrency: Math.max(Math.min(cpus().length - 1, 4), 2),
3737
// When in Continuous Integration, allow double the default test timeout (assuming "frugal" runner type)
38-
testTimeout: env.CI === 'true' ? 10_000 : undefined,
38+
testTimeout: env.CI === 'true' ? 30_000 : undefined,
3939
};
4040

4141
/**

superchain/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,17 @@ RUN apt-key add /tmp/nodesource.asc && rm /tmp/nodesource.asc
219219
RUN pip install aws-sam-cli \
220220
&& sam --version
221221

222+
# Install Amazon SSM agent (allows debugging of builds via `codebuild-breakpoint`, https://go.aws/3TVW7vL)
223+
RUN apt-get update \
224+
&& apt-get -y install curl \
225+
&& curl -fSsL "https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_${TARGETPLATFORM#linux/}/amazon-ssm-agent.deb" \
226+
-o /tmp/amazon-ssm-agent.deb \
227+
&& dpkg -i /tmp/amazon-ssm-agent.deb \
228+
&& systemctl enable amazon-ssm-agent \
229+
&& rm -rf /var/lib/apt/lists/*
230+
COPY --chown=superchain:superchain superchain/amazon-ssm-agent.json /etc/amazon/ssm/amazon-ssm-agent.json
231+
232+
222233
# Install some configuration
223234
COPY superchain/ssh_config /root/.ssh/config
224235
RUN chmod 600 /root/.ssh/config

superchain/amazon-ssm-agent.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"Profile":{
3+
"ShareCreds" : true,
4+
"ShareProfile" : ""
5+
},
6+
"Mds": {
7+
"CommandWorkersLimit" : 5,
8+
"StopTimeoutMillis" : 20000,
9+
"Endpoint": "",
10+
"CommandRetryLimit": 15
11+
},
12+
"Ssm": {
13+
"Endpoint": "",
14+
"HealthFrequencyMinutes": 5,
15+
"CustomInventoryDefaultLocation" : "",
16+
"AssociationLogsRetentionDurationHours" : 24,
17+
"RunCommandLogsRetentionDurationHours" : 336,
18+
"SessionLogsRetentionDurationHours" : 336
19+
},
20+
"Mgs": {
21+
"Region": "",
22+
"Endpoint": "",
23+
"StopTimeoutMillis" : 20000,
24+
"SessionWorkersLimit" : 1000
25+
},
26+
"Agent": {
27+
"Region": "",
28+
"OrchestrationRootDir": "",
29+
"ContainerMode": true
30+
},
31+
"Os": {
32+
"Lang": "en-US",
33+
"Name": "",
34+
"Version": "1"
35+
},
36+
"S3": {
37+
"Endpoint": "",
38+
"Region": "",
39+
"LogBucket":"",
40+
"LogKey":""
41+
},
42+
"Kms": {
43+
"Endpoint": ""
44+
}
45+
}

0 commit comments

Comments
 (0)