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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ cdk.context.json

# GitHub SSH public keys cache
.gh_ssh_keys_*

build
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.1
22.17.1
16 changes: 11 additions & 5 deletions lib/aws-semaphore-agent-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { Function, Runtime, AssetCode } = require("aws-cdk-lib/aws-lambda");
const { Policy, PolicyStatement, Role, ServicePrincipal, ManagedPolicy, Effect } = require("aws-cdk-lib/aws-iam");
const { CfnAutoScalingGroup } = require("aws-cdk-lib/aws-autoscaling");
const { Alias } = require("aws-cdk-lib/aws-kms");
const { SecurityGroup, Vpc, Peer, Port, LookupMachineImage, UserData, LaunchTemplate, SubnetType, InstanceInitiatedShutdownBehavior } = require("aws-cdk-lib/aws-ec2");
const { SecurityGroup, Vpc, Peer, Port, LookupMachineImage, UserData, LaunchTemplate, SubnetType, InstanceInitiatedShutdownBehavior, KeyPair } = require("aws-cdk-lib/aws-ec2");
const { CfnGroup } = require("aws-cdk-lib/aws-resourcegroups");

class AwsSemaphoreAgentStack extends Stack {
Expand Down Expand Up @@ -269,7 +269,9 @@ class AwsSemaphoreAgentStack extends Stack {
maxEventAge: Duration.minutes(1),
retryAttempts: 0,
role: lambdaRole,
logRetention: RetentionDays.ONE_MONTH,
logGroup: {
retention: RetentionDays.ONE_MONTH
},
environment: {
"SEMAPHORE_AGENT_TOKEN_PARAMETER_NAME": this.argumentStore.get("SEMAPHORE_AGENT_TOKEN_PARAMETER_NAME"),
"SEMAPHORE_AGENT_STACK_NAME": this.stackName,
Expand Down Expand Up @@ -335,7 +337,7 @@ class AwsSemaphoreAgentStack extends Stack {
userData: this.getUserData(),
blockDevices: this.createBlockDevices(),
instanceInitiatedShutdownBehavior: InstanceInitiatedShutdownBehavior.TERMINATE,
keyName: keyName != "" ? keyName : undefined
keyPair: keyName != "" ? KeyPair.fromKeyPairName(this, "keyPair", keyName) : undefined
}
if (this.argumentStore.get("SEMAPHORE_AGENT_USE_IPV6") !== "true") {
// To enable IPv6, a network interface must be specified.
Expand Down Expand Up @@ -549,12 +551,16 @@ class AwsSemaphoreAgentStack extends Stack {
code: new AssetCode("lambdas/az-rebalance-suspender"),
handler: "app.handler",
role: suspenderRole,
logRetention: RetentionDays.ONE_MONTH
logGroup: {
retention: RetentionDays.ONE_MONTH
}
});

const provider = new Provider(this, "azRebalanceSuspenderProvider", {
onEventHandler: suspenderFunction,
logRetention: RetentionDays.ONE_MONTH
logGroup: {
retention: RetentionDays.ONE_MONTH
}
});

return new CustomResource(this, "azRebalanceSuspender", {
Expand Down
4 changes: 3 additions & 1 deletion lib/dynamic-ssh-keys-updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ class DynamicSSHKeysUpdater extends Construct {
code: new AssetCode('lambdas/ssh-keys-updater'),
handler: 'app.handler',
role: role,
logRetention: RetentionDays.ONE_MONTH,
logGroup: {
retention: RetentionDays.ONE_MONTH
},
environment: {
"SSM_PARAMETER": parameterName
}
Expand Down
Loading