You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wriing code at lib folder like below and run build
import * as cdk from '@aws-cdk/core';
// import * as iam from '@aws-cdk/aws-iam';
import { EventsRuleToSnsProps, EventsRuleToSns } from "@aws-solutions-constructs/aws-events-rule-sns";
export class CdkEventbridgeRuleStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const envcode = new cdk.CfnParameter(this, "envcode", {
type: "String",
description: "envcode"
});
// this is a pattern to notify
const patternToNotify={
"source": [
"aws.trustedadvisor"
],
"detail-type": [
"Trusted Advisor Check Item Refresh Notification"
],
"detail": {
"status": [
"ERROR",
"WARN"
],
"check-name": ["Amazon EBS Public Snapshots"]
}
}
const constructStack = new EventsRuleToSns(this, 'eveSns', {
eventRuleProps: {
eventPattern: patternToNotify,
ruleName: `${envcode.valueAsString}-TrustedAdvisor-Notif`
},
topicProps:{
topicName:`${envcode.valueAsString}-TrustedAdvisor-Notif`
},
enableEncryptionWithCustomerManagedKey: false
});
// // Grant yourself permissions to use the Customer Managed KMS Key
// const policyStatement = new iam.PolicyStatement({
// actions: ["kms:Encrypt", "kms:Decrypt"],
// effect: iam.Effect.ALLOW,
// principals: [ new iam.AccountRootPrincipal() ],
// resources: [ "*" ]
// });
// constructStack.encryptionKeyProps?.alias?('alias/aws/sns')
}
}
Error Log
- error TS2345: Argument of type '{ eventRuleProps: { eventPattern: { source: string[]; "detail-type": string[]; detail: { status: string[]; "check-name": string[]; }; }; ruleName: string; }; topicProps: { topicName: string; }; enableEncryptionWithCustomerManagedKey: false; }' is not assignable to parameter of type 'EventsRuleToSnsProps'.
Object literal may only specify known properties, but 'topicProps' does not exist in type 'EventsRuleToSnsProps'. Did you mean to write 'topicsProps'?
37 topicProps:{
~~~~~~~~~~~~
38 topicName:`${envcode.valueAsString}-TrustedAdvisor-Notif`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 },
~~~~~~~
Found 1 error.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kota.tomimatsu/.npm/_logs/2021-06-11T06_09_04_156Z-debug.log
Environment
CDK CLI Version :1.107.0
CDK Framework Version:1.106.1
AWS Solutions Constructs Version :1.106.1
OS :mac catalina10.15.7
Language :japanese
Other
It works (build and deploy successfully) when I update my source from [※1] to [※2] .
[※1]topicProps
[※2]topicsProps
I didn't know which is better to update document like above or update code from [※2] to [※1],
In my opinion , I think it's better to update code
because topicProps comes from sns.TopicProps (which is not sns.Topic[s]Props ).
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered:
I think it is supposed to update from [※1] to [※2] at Name column of table link below.
[※1]topicProps
[※2]topicsProps
https://github.com/awslabs/aws-solutions-constructs/tree/main/source/patterns/@aws-solutions-constructs/aws-events-rule-sns#pattern-construct-props
Reproduction Steps
wriing code at lib folder like below and run build
Error Log
Environment
Other
It works (build and deploy successfully) when I update my source from [※1] to [※2] .
[※1]topicProps
[※2]topicsProps
I didn't know which is better to update document like above or update code from [※2] to [※1],
In my opinion , I think it's better to update code
because topicProps comes from sns.TopicProps (which is not sns.Topic[s]Props ).
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: