Skip to content
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

ci: update region denylist for lambda layers #1171

Merged
merged 1 commit into from
Dec 22, 2023
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
6 changes: 5 additions & 1 deletion lambda-layers/bin/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ async function publishLayerToRegion(
})
if (await isDescriptionUpdated(descriptionText, lambda, layerName)) {
try {
console.log(`Publishing to: ${region}`);
const publishResult = await lambda.publishLayerVersion({
LayerName: layerName,
Content: {
Expand Down Expand Up @@ -98,6 +99,9 @@ getRegions().then(regions => {
licenseText,
region,
runtimes,
);
).catch(e => {
console.error(`Failed publishing in ${region}, which may be due to the REGION_DENY_LIST needing updating. Error: ${e}`);
throw e;
});
}
});
8 changes: 8 additions & 0 deletions lambda-layers/lib/get-regions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@
import { SSM } from 'aws-sdk';

// These regions need to be enabled for the AWS account being used for publishing, so we skip them
// See https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html
const REGION_DENY_LIST = [
'af-south-1',
'ap-east-1',
'ap-south-2',
'ap-southeast-3',
'ap-southeast-4',
'ca-west-1',
'eu-south-1',
'eu-south-2',
'eu-central-2',
'il-central-1',
'me-south-1',
'me-central-1',
];

function isValidRegion(region: string): boolean {
Expand Down