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(ec2): expose EntryProperty #32060

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 9 additions & 1 deletion packages/aws-cdk-lib/aws-ec2/lib/prefix-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ export interface IPrefixList extends IResource {
readonly prefixListId: string;
}

/**
* An entry for a prefix list.
*/
export interface EntryProperty extends CfnPrefixList.EntryProperty{
cidr: string;
description?: string;
}

/**
* The IP address type.
*/
Expand Down Expand Up @@ -60,7 +68,7 @@ export interface PrefixListProps extends PrefixListOptions {
*
* @default []
*/
readonly entries?: CfnPrefixList.EntryProperty[];
readonly entries?: EntryProperty[];
}

/**
Expand Down
12 changes: 7 additions & 5 deletions packages/aws-cdk-lib/aws-ec2/test/prefix-list.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Template } from '../../assertions';
import { Stack } from '../../core';
import { AddressFamily, PrefixList } from '../lib/prefix-list';
import { AddressFamily, EntryProperty, PrefixList } from '../lib/prefix-list';

describe('prefix list', () => {
test('default empty prefixlist', () => {
Expand Down Expand Up @@ -35,11 +35,13 @@ describe('prefix list', () => {
test('prefixlist with entries', () => {
// GIVEN
const stack = new Stack();

const entries: EntryProperty[] = [
{ cidr: '10.0.0.1/32' },
{ cidr: '10.0.0.2/32', description: 'sample1' },
];
new PrefixList(stack, 'prefix-list', {
entries: [
{ cidr: '10.0.0.1/32' },
{ cidr: '10.0.0.2/32', description: 'sample1' },
],
entries,
prefixListName: 'prefix-list',
});

Expand Down
Loading