-
Notifications
You must be signed in to change notification settings - Fork 825
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
Conversation
@@ -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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
RoleArn: params.EmailChannelRequest.RoleArn, | |
RoleArn: data.EmailChannelResponse ?? params.EmailChannelRequest.RoleArn, |
There was a problem hiding this comment.
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?
const validateInputParams = (channelInput: $TSAny) : $TSAny => { | ||
if (!channelInput.FromAddress || !channelInput.Identity || !channelInput.RoleArn) { | ||
const validateInputParams = (channelInput: $TSAny): $TSAny => { | ||
if (!channelInput.FromAddress || !channelInput.Identity) { |
There was a problem hiding this comment.
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.
Description of changes
Issue #11819
Description of how you validated changes
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.