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(ses): allow VDM settings at the configuration set level #30051

Merged
merged 14 commits into from
Jun 18, 2024

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented May 3, 2024

Issue # (if applicable)

Closes #30041 .

Reason for this change

As described in the issue.

Description of changes

To allow VDM settings at the configuration set level, vdmOptions property has been added to the ConfigurationSet Construct.

new ses.ConfigurationSet(this, 'ConfigurationSetWithVdmOptions', {
  vdmOptions: { // Add
    engagementMetrics: true,
    optimizedSharedDelivery: true,
  },
});

Description of how you validated changes

I implemented unit tests and integration tests for the three cases.

  1. Configuration set with both engagement metrics and optimized shared delivery enabled.
  2. Configuration set with only engagement metrics enabled and optimized shared delivery not configured.
  3. Configuration set with only optimized shared delivery enabled and engagement metrics not configured.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels May 3, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team May 3, 2024 12:54
@mazyu36 mazyu36 changed the title (ses): allow VDM settings at the configuration set level feat(ses): allow VDM settings at the configuration set level May 3, 2024
Copy link
Contributor

@nmussy nmussy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor issues, good work overall 👍

packages/aws-cdk-lib/aws-ses/README.md Outdated Show resolved Hide resolved
/**
* The Virtual Deliverability Manager (VDM) options that apply to the configuration set
*
* @default - use account level settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably indicate what the default values are first, and mention that this can be overridden by account level settings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review.
I've stated that "default" indicates the absence of settings at the Configuration level, and in such cases, settings at the account level will be applied.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should have made myself clearer. I think it's more important to tell the users that by default, VDM options are disabled, unless there are account level settings. Your current documentation only states that if they happen to have account level settings, those will be used. I would expect most of the CDK users will not be using account level settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand. Sorry for the lack of explanation.

However, my understanding is that the configuration set level settings need to be used together with the account level settings. (Deploying with only the configuration set level settings enabled is possible, but VDM itself cannot be used until the account level settings are enabled.)

That's why I tried to include the above as a Note in the README, but I would like your opinion.
I'm a little unsure about how it should be written...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, got it. The AWS documentation doesn't really make it explicit that they need to be enabled account wide first:

Virtual Deliverability Manager options are also provided at the configuration set level so you can define custom settings for how a configuration set will use engagement tracking and optimized shared delivery by overriding how they’ve been defined in Virtual Deliverability Manager.

I would really emphasize it in the TSDoc as well, the README seems to have it covered

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmussy
Thank you. I have added a note to the README and docs that when setting Account Level settings with CDK, VdmAttributes should be used.

/**
* Whether engagement metrics are enabled for the configuration set
*
* @default - use account level settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same as the comment above.

/**
* Whether optimized shared delivery is enabled for the configuration set
*
* @default - use account level settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same as the comment above.

Comment on lines 64 to 96
test('configuration set with engagement metrics only', () => {
new ConfigurationSet(stack, 'ConfigurationSet', {
vdmOptions: {
engagementMetrics: true,
},
});

Template.fromStack(stack).hasResourceProperties('AWS::SES::ConfigurationSet', {
VdmOptions: {
DashboardOptions: {
EngagementMetrics: 'ENABLED',
},
GuardianOptions: Match.absent(),
},
});
});

test('configuration set with optimized shared delivery only', () => {
new ConfigurationSet(stack, 'ConfigurationSet', {
vdmOptions: {
optimizedSharedDelivery: true,
},
});

Template.fromStack(stack).hasResourceProperties('AWS::SES::ConfigurationSet', {
VdmOptions: {
DashboardOptions: Match.absent(),
GuardianOptions: {
OptimizedSharedDelivery: 'ENABLED',
},
},
});
});
Copy link
Contributor

@nmussy nmussy May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests seem a bit superfluous, given they're already being covered by the first one. It'd be more appropriate to test vdmOptions: {false, false} and vdmOptions: {},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added test cases for when both options in vdmOptions are set to "DISABLED" and when vdmOptions itself is not configured.

Additionally, I'm sorry to say that I've realized from the results of these tests that the "DISABLED" setting cannot be implemented. Therefore, I'm revisiting the implementation of vdmOptions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried setting it to DISABLED with ENABLED account wide settings? That might be the only allowed use case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did and I could.

As I mentioned in a separate comment, the configuration set level settings can be deployed on their own, but to enable VDM, it is appropriate to configure them together with the account level settings.
Therefore, I also added the account level settings to the integration tests.

packages/aws-cdk-lib/aws-ses/lib/configuration-set.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ses/lib/configuration-set.ts Outdated Show resolved Hide resolved
mazyu36 and others added 6 commits May 3, 2024 22:29
Co-authored-by: Jimmy Gaussen <jimmy.gaussen@gmail.com>
Co-authored-by: Jimmy Gaussen <jimmy.gaussen@gmail.com>
Co-authored-by: Jimmy Gaussen <jimmy.gaussen@gmail.com>
Co-authored-by: Jimmy Gaussen <jimmy.gaussen@gmail.com>
@mazyu36
Copy link
Contributor Author

mazyu36 commented May 3, 2024

@nmussy
Thank you for your review! I have addressed the comments you provided.

Comment on lines 27 to 30
new ses.VdmAttributes(this, 'VdmAccountLevelSettings', {
engagementMetrics: true,
optimizedSharedDelivery: true,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there are the account-wide settings? I would indicate the construct name in the README and the TSDoc if that's the case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the other comments, the README and docs have been updated.

Comment on lines 36 to 38
new integ.IntegTest(app, 'ConfigurationSetVdmOptionsInteg', {
testCases: [new TestStack(app, 'cdk-ses-configuration-set-vdmoptions-integ')],
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably a good idea to run some assertions to make sure that the configuration sets and VdmAttributes are created with the expected values, see integ-tests. Let me know if you need some guidance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmussy
Thank you for your comments. I have added assertions using AwsApiCall for integration testing. Please let me know if there are any inappropriate parts.

Copy link
Contributor

@nmussy nmussy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the changes 👍

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label May 6, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thanks for contributing!

Copy link
Contributor

mergify bot commented Jun 18, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 18, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0059d36
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 49a98ac into aws:main Jun 18, 2024
13 checks passed
Copy link
Contributor

mergify bot commented Jun 18, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mazyu36 mazyu36 deleted the ses-vdmoptions branch June 21, 2024 03:23
sarangarav pushed a commit to sarangarav/aws-cdk that referenced this pull request Jun 21, 2024
### Issue # (if applicable)

Closes aws#30041 .

### Reason for this change
As described in the issue.



### Description of changes
To allow VDM settings at the configuration set level, `vdmOptions` property has been added to the `ConfigurationSet` Construct.

```ts
new ses.ConfigurationSet(this, 'ConfigurationSetWithVdmOptions', {
  vdmOptions: { // Add
    engagementMetrics: true,
    optimizedSharedDelivery: true,
  },
});
```



### Description of how you validated changes
I implemented unit tests and integration tests for the three cases.

1. Configuration set with both engagement metrics and optimized shared delivery enabled.
2. Configuration set with only engagement metrics enabled and optimized shared delivery not configured.
3. Configuration set with only optimized shared delivery enabled and engagement metrics not configured.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mazyu36 added a commit to mazyu36/aws-cdk that referenced this pull request Jun 22, 2024
### Issue # (if applicable)

Closes aws#30041 .

### Reason for this change
As described in the issue.



### Description of changes
To allow VDM settings at the configuration set level, `vdmOptions` property has been added to the `ConfigurationSet` Construct.

```ts
new ses.ConfigurationSet(this, 'ConfigurationSetWithVdmOptions', {
  vdmOptions: { // Add
    engagementMetrics: true,
    optimizedSharedDelivery: true,
  },
});
```



### Description of how you validated changes
I implemented unit tests and integration tests for the three cases.

1. Configuration set with both engagement metrics and optimized shared delivery enabled.
2. Configuration set with only engagement metrics enabled and optimized shared delivery not configured.
3. Configuration set with only optimized shared delivery enabled and engagement metrics not configured.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(ses): enable setting vdmOptions in ConfigurationSet
4 participants