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: store email channel role arn to amplify meta output #11883

Merged
merged 1 commit into from
Feb 2, 2023
Merged

fix: store email channel role arn to amplify meta output #11883

merged 1 commit into from
Feb 2, 2023

Conversation

lazpavel
Copy link
Contributor

@lazpavel lazpavel commented Feb 1, 2023

Description of changes

  • stores role arn for email channel notifications to amplify meta channel output section

Issue #11819

Description of how you validated changes

  • manual and unit tests

Checklist

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

@lazpavel lazpavel linked an issue Feb 1, 2023 that may be closed by this pull request
2 tasks
@@ -69,7 +69,10 @@ export const enable = async (context:$TSContext, successMessage: string|undefine
try {
const data = await context.exeInfo.pinpointClient.updateEmailChannel(params).promise();
spinner.succeed(successMessage ?? `The ${channelName} channel has been successfully enabled.`);
context.exeInfo.serviceMeta.output[channelName] = data.EmailChannelResponse;
context.exeInfo.serviceMeta.output[channelName] = {
RoleArn: params.EmailChannelRequest.RoleArn,
Copy link
Contributor Author

@lazpavel lazpavel Feb 1, 2023

Choose a reason for hiding this comment

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

1/2 change in the file is setting the RoleArn from the input parameters, this issue is caused by a bug in the pinpoint CDK not returning the RoleArn in the EmailChannelResponse body as stated in this documentation. Filed a ticket against Pinpoint CDK and this change is meant to be a temporary workaround until the root cause is being fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do like below if the pinpoint cdk returning undefined or null

Suggested change
RoleArn: params.EmailChannelRequest.RoleArn,
RoleArn: data.EmailChannelResponse ?? params.EmailChannelRequest.RoleArn,

Copy link
Contributor

@Amplifiyer Amplifiyer Feb 2, 2023

Choose a reason for hiding this comment

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

If the roleArn is an optional field, will it cause problem to send a null or empty string here?

@lazpavel lazpavel marked this pull request as ready for review February 1, 2023 16:13
@lazpavel lazpavel requested a review from a team as a code owner February 1, 2023 16:13
const validateInputParams = (channelInput: $TSAny) : $TSAny => {
if (!channelInput.FromAddress || !channelInput.Identity || !channelInput.RoleArn) {
const validateInputParams = (channelInput: $TSAny): $TSAny => {
if (!channelInput.FromAddress || !channelInput.Identity) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

2/2 change of the file. RoleArn is an optional field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RoleArn for Email notifications does get added to amplify-meta
5 participants