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

feat!: updating the AmazonMQ broker engine versions #47

Merged
merged 2 commits into from
Oct 28, 2024
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
3 changes: 3 additions & 0 deletions .github/workflows/release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

364 changes: 189 additions & 175 deletions API.md

Large diffs are not rendered by default.

21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,14 @@ declare const brokerUser: ISecret;

const broker = new ActiveMqBrokerInstance(stack, 'ActiveMqBroker', {
publiclyAccessible: false,
version: ActiveMqBrokerEngineVersion.V5_17_6,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.MICRO),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [{
username: brokerUser.secretValueFromJson('username').unsafeUnwrap(),
password: brokerUser.secretValueFromJson('password'),
}],
}),
autoMinorVersionUpgrade: true,
});
```

Expand Down Expand Up @@ -116,15 +115,14 @@ declare const vpcSubnets: SubnetSelection;

const brokerPair = new ActiveMqBrokerRedundantPair(stack, 'ActiveMqBrokerPair', {
publiclyAccessible: false,
version: ActiveMqBrokerEngineVersion.V5_17_6,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [{
username: brokerUser.secretValueFromJson('username').unsafeUnwrap(),
password: brokerUser.secretValueFromJson('password'),
}],
}),
autoMinorVersionUpgrade: true,
vpc,
vpcSubnets,
});
Expand Down Expand Up @@ -230,7 +228,6 @@ const broker = new ActiveMqBrokerInstance(stack, 'Broker', {
password: brokerUser.secretValueFromJson('password'),
}],
}),
autoMinorVersionUpgrade: true,
configuration: customConfiguration
});
```
Expand Down Expand Up @@ -295,7 +292,7 @@ declare const serviceAccountSecret: ISecret;

const broker = new ActiveMqBrokerInstance(stack, 'ActiveMqBrokerInstance', {
publiclyAccessible: false,
version: ActiveMqBrokerEngineVersion.V5_17_6,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.MICRO),
userManagement: ActiveMqBrokerUserManagement.ldap({
hosts: ['ldap.example.com'],
Expand All @@ -308,7 +305,6 @@ const broker = new ActiveMqBrokerInstance(stack, 'ActiveMqBrokerInstance', {
serviceAccountPassword: serviceAccountSecret.secretValueFromJson('password'),
serviceAccountUsername: serviceAccountSecret.secretValueFromJson('username'),
}),
autoMinorVersionUpgrade: true,
});
```

Expand Down Expand Up @@ -393,13 +389,12 @@ declare const adminSecret: ISecret;

const broker = new RabbitMqBrokerInstance(stack, 'RabbitMqBroker', {
publiclyAccessible: false,
version: RabbitMqBrokerEngineVersion.V3_11_20,
version: RabbitMqBrokerEngineVersion.V3_13,
instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.MICRO),
admin: {
username: adminSecret.secretValueFromJson('username').unsafeUnwrap(),
password: adminSecret.secretValueFromJson('password'),
},
autoMinorVersionUpgrade: true,
});
```

Expand All @@ -418,13 +413,12 @@ declare const adminSecret: ISecret;

const broker = new RabbitMqBrokerCluster(stack, 'RabbitMqBroker', {
publiclyAccessible: false,
version: RabbitMqBrokerEngineVersion.V3_11_20,
version: RabbitMqBrokerEngineVersion.V3_13,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
admin: {
username: adminSecret.secretValueFromJson('username').unsafeUnwrap(),
password: adminSecret.secretValueFromJson('password'),
},
autoMinorVersionUpgrade: true,
});
```

Expand Down Expand Up @@ -485,21 +479,20 @@ declare const adminSecret: ISecret;
const customConfiguration = new RabbitMqBrokerConfiguration(stack, 'CustomConfiguration', {
configurationName: 'ConfigurationName',
description: 'ConfigurationDescription',
engineVersion: RabbitMqBrokerEngineVersion.V3_11_20,
engineVersion: RabbitMqBrokerEngineVersion.V3_13,
definition: RabbitMqBrokerConfigurationDefinition.parameters({
consumerTimeout: Duration.minutes(20),
}),
});

const broker = new RabbitMqBrokerInstance(stack, 'Broker', {
publiclyAccessible: false,
version: RabbitMqBrokerEngineVersion.V3_11_20,
version: RabbitMqBrokerEngineVersion.V3_13,
instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.MICRO),
admin: {
username: adminSecret.secretValueFromJson('username').unsafeUnwrap(),
password: adminSecret.secretValueFromJson('password'),
},
autoMinorVersionUpgrade: true,
configuration: customConfiguration
});
```
Expand Down
7 changes: 4 additions & 3 deletions src/activemq/activemq-broker-engine-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ SPDX-License-Identifier: Apache-2.0
*/

/**
* The Amazon ActiveMQ Broker Engine version.
*
* @see: https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/activemq-version-management.html
* @see https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/activemq-version-management.html
*/
export class ActiveMqBrokerEngineVersion {
public static readonly V5_18 = new ActiveMqBrokerEngineVersion('5.18');

/** it is recommended to use V5_18 instead */
public static readonly V5_17_6 = new ActiveMqBrokerEngineVersion('5.17.6');

/** @deprecated use V5_18 instead */
public static readonly V5_16_7 = new ActiveMqBrokerEngineVersion('5.16.7');

public static readonly V5_15_16 = new ActiveMqBrokerEngineVersion('5.15.16');

public static of(version: string): ActiveMqBrokerEngineVersion {
return new ActiveMqBrokerEngineVersion(version);
}
Expand Down
8 changes: 5 additions & 3 deletions src/broker-deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ export interface BrokerDeploymentProps {
readonly instanceType: InstanceType;

/**
* Determines whether the broker will undergo a minor version upgrade during the maintenance window.
* Determines whether the broker will undergo a patch version upgrade during the maintenance window.
*
* @default - false. No minor version upgrade happens.
* NOTE: Contrary to the name this setting does not upgrade the minor versions, but patch versions (i.e. in the X.Y.Z notation - only the Z numbers are upgraded)
*
* @default - for versions with the patch version number the default is not to upgrade the patch versions; for versions withouth the patch version number patch versions are updated and this setting takes no effect.
*/
readonly autoMinorVersionUpgrade: boolean;
readonly autoMinorVersionUpgrade?: boolean;
readonly maintenanceWindowStartTime?: MaintenanceWindowStartTime;

/**
Expand Down
15 changes: 9 additions & 6 deletions src/rabbitmq/rabbitmq-broker-engine-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
/**
* The Amazon RabbitMQ Broker Engine version.
*
* @see: https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/rabbitmq-version-management.html
* @see https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/rabbitmq-version-management.html
*/
export class RabbitMqBrokerEngineVersion {
public static readonly V3_13 = new RabbitMqBrokerEngineVersion('3.13');

/** @deprecated use V3_13 instead */
public static readonly V3_12_13 = new RabbitMqBrokerEngineVersion('3.12.13');

public static readonly V3_11_20 = new RabbitMqBrokerEngineVersion('3.11.20');

public static readonly V3_10_20 = new RabbitMqBrokerEngineVersion('3.10.20');
/** @deprecated use V3_13 instead */
public static readonly V3_11_28 = new RabbitMqBrokerEngineVersion('3.11.28');

public static readonly V3_9_27 = new RabbitMqBrokerEngineVersion('3.9.27');
/** @deprecated use V3_13 instead */
public static readonly V3_11_20 = new RabbitMqBrokerEngineVersion('3.11.20');

public static readonly V3_8_34 = new RabbitMqBrokerEngineVersion('3.8.34');
/** @deprecated use V3_13 instead */
public static readonly V3_11_16 = new RabbitMqBrokerEngineVersion('3.11.16');

public static of(version: string): RabbitMqBrokerEngineVersion {
return new RabbitMqBrokerEngineVersion(version);
Expand Down
16 changes: 8 additions & 8 deletions test/activemq/activemq-broker-configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('ActiveMqBrokerConfiguration', () => {
new ActiveMqBrokerConfiguration(stack, 'TestConfig', {
description: 'Test Description',
definition: ActiveMqBrokerConfigurationDefinition.data('Test Definition'),
engineVersion: ActiveMqBrokerEngineVersion.V5_15_16,
engineVersion: ActiveMqBrokerEngineVersion.V5_18,
});

const template = Template.fromStack(stack);
Expand All @@ -23,7 +23,7 @@ describe('ActiveMqBrokerConfiguration', () => {
Data: { 'Fn::Base64': 'Test Definition' },
Description: 'Test Description',
EngineType: 'ACTIVEMQ',
EngineVersion: '5.15.16',
EngineVersion: '5.18',
Name: 'TestConfig',
});
});
Expand All @@ -34,12 +34,12 @@ describe('ActiveMqBrokerConfiguration', () => {
const config = new ActiveMqBrokerConfiguration(stack, 'TestConfig', {
description: 'Test Description',
definition: ActiveMqBrokerConfigurationDefinition.data('Test Definition'),
engineVersion: ActiveMqBrokerEngineVersion.V5_15_16,
engineVersion: ActiveMqBrokerEngineVersion.V5_18,
});

const broker = new ActiveMqBrokerInstance(stack, 'TestBroker', {
publiclyAccessible: true,
version: ActiveMqBrokerEngineVersion.V5_15_16,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [{
Expand All @@ -63,7 +63,7 @@ describe('ActiveMqBrokerConfiguration', () => {
Data: { 'Fn::Base64': 'Test Definition' },
Description: 'Test Description',
EngineType: 'ACTIVEMQ',
EngineVersion: '5.15.16',
EngineVersion: '5.18',
Name: 'TestConfig',
});

Expand Down Expand Up @@ -118,12 +118,12 @@ describe('ActiveMqBrokerConfiguration', () => {
const config = new ActiveMqBrokerConfiguration(stack, 'TestConfig', {
description: 'Test Description',
definition: ActiveMqBrokerConfigurationDefinition.data('Test Definition'),
engineVersion: ActiveMqBrokerEngineVersion.V5_15_16,
engineVersion: ActiveMqBrokerEngineVersion.V5_18,
});

const broker = new ActiveMqBrokerInstance(stack, 'TestBroker', {
publiclyAccessible: true,
version: ActiveMqBrokerEngineVersion.V5_15_16,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [{
Expand All @@ -142,7 +142,7 @@ describe('ActiveMqBrokerConfiguration', () => {
Data: { 'Fn::Base64': 'Test Definition' },
Description: 'Test Description',
EngineType: 'ACTIVEMQ',
EngineVersion: '5.15.16',
EngineVersion: '5.18',
Name: 'TestConfig',
});

Expand Down
2 changes: 1 addition & 1 deletion test/activemq/activemq-broker-deployment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('ActiveMqBrokerDeployment', () => {

const broker: IActiveMqBrokerDeployment = new ActiveMqBrokerInstance(stack, 'TestBroker', {
publiclyAccessible: false,
version: ActiveMqBrokerEngineVersion.V5_15_16,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [{
Expand Down
2 changes: 1 addition & 1 deletion test/activemq/activemq-broker-endpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
const createBroker = (stack: Stack) => {
return new ActiveMqBrokerInstance(stack, 'TestBroker', {
publiclyAccessible: true,
version: ActiveMqBrokerEngineVersion.V5_15_16,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [
Expand Down
1 change: 0 additions & 1 deletion test/activemq/activemq-broker-engine-version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe('ActiveMqBrokerEngineVersion', () => {
{ version: '5.18' },
{ version: '5.17.6' },
{ version: '5.16.7' },
{ version: '5.15.16' },
];
const actualEngineVersions = Object.values(ActiveMqBrokerEngineVersion);

Expand Down
16 changes: 8 additions & 8 deletions test/activemq/activemq-broker-instance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('ActiveMqBrokerInstance', () => {

const broker = new ActiveMqBrokerInstance(stack, 'TestBroker', {
publiclyAccessible: true,
version: ActiveMqBrokerEngineVersion.V5_15_16,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [{
Expand All @@ -41,7 +41,7 @@ describe('ActiveMqBrokerInstance', () => {
DeploymentMode: 'SINGLE_INSTANCE',
EncryptionOptions: { UseAwsOwnedKey: true },
EngineType: 'ACTIVEMQ',
EngineVersion: '5.15.16',
EngineVersion: '5.18',
HostInstanceType: 'mq.m5.large',
PubliclyAccessible: true,
Users: [{
Expand All @@ -59,7 +59,7 @@ describe('ActiveMqBrokerInstance', () => {
const broker = new ActiveMqBrokerInstance(stack, 'TestBroker', {
publiclyAccessible: true,
key,
version: ActiveMqBrokerEngineVersion.V5_15_16,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [{
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('ActiveMqBrokerInstance', () => {
UseAwsOwnedKey: false,
},
EngineType: 'ACTIVEMQ',
EngineVersion: '5.15.16',
EngineVersion: '5.18',
HostInstanceType: 'mq.m5.large',
PubliclyAccessible: true,
Users: [{
Expand All @@ -108,7 +108,7 @@ describe('ActiveMqBrokerInstance', () => {

const broker = new ActiveMqBrokerInstance(stack, 'TestBroker', {
publiclyAccessible: false,
version: ActiveMqBrokerEngineVersion.V5_15_16,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [{
Expand All @@ -133,7 +133,7 @@ describe('ActiveMqBrokerInstance', () => {
DeploymentMode: 'SINGLE_INSTANCE',
EncryptionOptions: { UseAwsOwnedKey: true },
EngineType: 'ACTIVEMQ',
EngineVersion: '5.15.16',
EngineVersion: '5.18',
HostInstanceType: 'mq.m5.large',
PubliclyAccessible: false,
Users: [{
Expand All @@ -152,7 +152,7 @@ describe('ActiveMqBrokerInstance', () => {

const broker = new ActiveMqBrokerInstance(stack, 'TestBroker', {
publiclyAccessible: false,
version: ActiveMqBrokerEngineVersion.V5_15_16,
version: ActiveMqBrokerEngineVersion.V5_18,
instanceType: InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),
userManagement: ActiveMqBrokerUserManagement.simple({
users: [{
Expand Down Expand Up @@ -203,7 +203,7 @@ describe('ActiveMqBrokerInstance', () => {
DeploymentMode: 'SINGLE_INSTANCE',
EncryptionOptions: { UseAwsOwnedKey: true },
EngineType: 'ACTIVEMQ',
EngineVersion: '5.15.16',
EngineVersion: '5.18',
HostInstanceType: 'mq.m5.large',
PubliclyAccessible: false,
Users: [{
Expand Down
Loading
Loading