-
Notifications
You must be signed in to change notification settings - Fork 690
feat(control-plane): tag controll plane created SSM Parameters (#4833) #4834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
377d2a2
36f4f61
a9d685d
7361092
9bf790d
340a39a
3ac7b16
1590623
1a5e241
8120634
8cd43d6
73a4f5b
e6befee
60e0d07
323333d
cf1b880
e7e0477
6f6c89b
7da8216
b64df62
d43ea2f
bb522d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -49,6 +49,7 @@ interface CreateGitHubRunnerConfig { | |||
| disableAutoUpdate: boolean; | ||||
| ssmTokenPath: string; | ||||
| ssmConfigPath: string; | ||||
| ssmParameterStoreTags: { Key: string; Value: string }[]; | ||||
| } | ||||
|
|
||||
| interface CreateEC2RunnerConfig { | ||||
|
|
@@ -182,6 +183,9 @@ async function getRunnerGroupId(githubRunnerConfig: CreateGitHubRunnerConfig, gh | |||
| `${githubRunnerConfig.ssmConfigPath}/runner-group/${githubRunnerConfig.runnerGroup}`, | ||||
| runnerGroupId.toString(), | ||||
| false, | ||||
| { | ||||
| tags: githubRunnerConfig.ssmParameterStoreTags, | ||||
| }, | ||||
| ); | ||||
| } catch (err) { | ||||
| logger.debug('Error storing runner group id in SSM Parameter Store', err as Error); | ||||
|
|
@@ -251,6 +255,10 @@ export async function scaleUp(eventSource: string, payload: ActionRequestMessage | |||
| const onDemandFailoverOnError = process.env.ENABLE_ON_DEMAND_FAILOVER_FOR_ERRORS | ||||
| ? (JSON.parse(process.env.ENABLE_ON_DEMAND_FAILOVER_FOR_ERRORS) as [string]) | ||||
| : []; | ||||
| const ssmParameterStoreTags: { Key: string; Value: string }[] = | ||||
| process.env.SSM_PARAMETER_STORE_TAGS && process.env.SSM_PARAMETER_STORE_TAGS.trim() !== '' | ||||
| ? JSON.parse(process.env.SSM_PARAMETER_STORE_TAGS) | ||||
| : []; | ||||
|
|
||||
| if (ephemeralEnabled && payload.eventType !== 'workflow_job') { | ||||
| logger.warn(`${payload.eventType} event is not supported in combination with ephemeral runners.`); | ||||
|
|
@@ -321,6 +329,7 @@ export async function scaleUp(eventSource: string, payload: ActionRequestMessage | |||
| disableAutoUpdate, | ||||
| ssmTokenPath, | ||||
| ssmConfigPath, | ||||
| ssmParameterStoreTags, | ||||
| }, | ||||
| { | ||||
| ec2instanceCriteria: { | ||||
|
|
@@ -407,7 +416,7 @@ async function createRegistrationTokenConfig( | |||
|
|
||||
| for (const instance of instances) { | ||||
| await putParameter(`${githubRunnerConfig.ssmTokenPath}/${instance}`, runnerServiceConfig.join(' '), true, { | ||||
| tags: [{ Key: 'InstanceId', Value: instance }], | ||||
| tags: [{ Key: 'InstanceId', Value: instance }, ...githubRunnerConfig.ssmParameterStoreTags], | ||||
| }); | ||||
| if (isDelay) { | ||||
| // Delay to prevent AWS ssm rate limits by being within the max throughput limit | ||||
|
|
@@ -465,7 +474,7 @@ async function createJitConfig(githubRunnerConfig: CreateGitHubRunnerConfig, ins | |||
| instance: instance, | ||||
| }); | ||||
| await putParameter(`${githubRunnerConfig.ssmTokenPath}/${instance}`, runnerConfig.data.encoded_jit_config, true, { | ||||
| tags: [{ Key: 'InstanceId', Value: instance }], | ||||
| tags: [{ Key: 'InstanceId', Value: instance }, ...githubRunnerConfig.ssmParameterStoreTags], | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change was not working, made a suggestion to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added terraform-aws-github-runner/lambdas/functions/control-plane/src/scale-runners/scale-up.ts Line 91 in d43ea2f
|
||||
| }); | ||||
| if (isDelay) { | ||||
| // Delay to prevent AWS ssm rate limits by being within the max throughput limit | ||||
|
|
||||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| locals { | ||
npalm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| parameter_store_tags = "[${join(", ", [ | ||
| for key, value in var.parameter_store_tags : "{ key = \"${key}\", value = \"${value}\" }" | ||
| ])}]" | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.