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

fix: wrong alb ip condition validation #11889

Merged
merged 3 commits into from Jun 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 3 additions & 8 deletions lib/plugins/aws/package/compile/events/alb/index.js
Expand Up @@ -7,8 +7,8 @@ const compileTargetGroups = require('./lib/target-groups');
const compileListenerRules = require('./lib/listener-rules');
const compilePermissions = require('./lib/permissions');

function defineArray(schema) {
return { type: 'array', items: schema };
function defineArray(schema, options = {}) {
return { type: 'array', items: schema, ...options };
}

class AwsCompileAlbEvents {
Expand Down Expand Up @@ -53,12 +53,7 @@ class AwsCompileAlbEvents {
pattern: '^[A-Za-z0-9*?.-]+$',
maxLength: 128,
}),
ip: defineArray({
anyOf: [
{ type: 'string', format: 'ipv4' },
{ type: 'string', format: 'ipv6' },
],
}),
ip: defineArray({ type: 'string' }, { uniqueItems: true }),
method: defineArray({ type: 'string', pattern: '^[A-Z_-]+$', maxLength: 40 }),
path: defineArray({
type: 'string',
Expand Down