Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(parent, id, providingStack) {
super(parent, id);
new sns.Topic(this, 'BogusTopic'); // Some filler
new cdk.Output(this, 'IConsumedSomething', { value: providingStack.stackName });
}
}
constructor(parent, id) {
super(parent, id);
new sns.Topic(this, 'BogusTopic'); // Some filler
}
}
? iam.Role.fromRoleArn(this, "SfnRole", props.sfnRoleARN, {
mutable: false,
})
: undefined;
this.cacheTable = new dynamodb.Table(this, "cacheTable", {
billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
sortKey: { name: "sk", type: dynamodb.AttributeType.STRING },
timeToLiveAttribute: "expires_at",
});
// ----------------------------------------------------------------
// Messaging Channels
this.alertTopic = new sns.Topic(this, "alertTopic");
this.taskTopic = new sns.Topic(this, "taskTopic");
this.contentTopic = new sns.Topic(this, "contentTopic");
this.attributeTopic = new sns.Topic(this, "attributeTopic");
this.reportTopic = new sns.Topic(this, "reportTopic");
const alertQueueTimeout = cdk.Duration.seconds(30);
this.alertQueue = new sqs.Queue(this, "alertQueue", {
visibilityTimeout: alertQueueTimeout,
});
this.alertTopic.addSubscription(new SqsSubscription(this.alertQueue));
const contentQueueTimeout = cdk.Duration.seconds(30);
this.contentQueue = new sqs.Queue(this, "contentQueue", {
visibilityTimeout: contentQueueTimeout,
});
const attributeQueueTimeout = cdk.Duration.seconds(30);
})
: undefined;
this.cacheTable = new dynamodb.Table(this, "cacheTable", {
billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
sortKey: { name: "sk", type: dynamodb.AttributeType.STRING },
timeToLiveAttribute: "expires_at",
});
// ----------------------------------------------------------------
// Messaging Channels
this.alertTopic = new sns.Topic(this, "alertTopic");
this.taskTopic = new sns.Topic(this, "taskTopic");
this.contentTopic = new sns.Topic(this, "contentTopic");
this.attributeTopic = new sns.Topic(this, "attributeTopic");
this.reportTopic = new sns.Topic(this, "reportTopic");
const alertQueueTimeout = cdk.Duration.seconds(30);
this.alertQueue = new sqs.Queue(this, "alertQueue", {
visibilityTimeout: alertQueueTimeout,
});
this.alertTopic.addSubscription(new SqsSubscription(this.alertQueue));
const contentQueueTimeout = cdk.Duration.seconds(30);
this.contentQueue = new sqs.Queue(this, "contentQueue", {
visibilityTimeout: contentQueueTimeout,
});
const attributeQueueTimeout = cdk.Duration.seconds(30);
this.attributeQueue = new sqs.Queue(this, "attributeQueue", {
visibilityTimeout: attributeQueueTimeout,
const sfnRole = props.sfnRoleARN
? iam.Role.fromRoleArn(this, "SfnRole", props.sfnRoleARN, {
mutable: false,
})
: undefined;
this.cacheTable = new dynamodb.Table(this, "cacheTable", {
billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
partitionKey: { name: "pk", type: dynamodb.AttributeType.STRING },
sortKey: { name: "sk", type: dynamodb.AttributeType.STRING },
timeToLiveAttribute: "expires_at",
});
// ----------------------------------------------------------------
// Messaging Channels
this.alertTopic = new sns.Topic(this, "alertTopic");
this.taskTopic = new sns.Topic(this, "taskTopic");
this.contentTopic = new sns.Topic(this, "contentTopic");
this.attributeTopic = new sns.Topic(this, "attributeTopic");
this.reportTopic = new sns.Topic(this, "reportTopic");
const alertQueueTimeout = cdk.Duration.seconds(30);
this.alertQueue = new sqs.Queue(this, "alertQueue", {
visibilityTimeout: alertQueueTimeout,
});
this.alertTopic.addSubscription(new SqsSubscription(this.alertQueue));
const contentQueueTimeout = cdk.Duration.seconds(30);
this.contentQueue = new sqs.Queue(this, "contentQueue", {
visibilityTimeout: contentQueueTimeout,
});
const apiBucket = new s3.Bucket(this, 'api-bucket', {
publicReadAccess: true,
websiteIndexDocument: 'index.json'
});
// An S3 bucket which holds the static content
const staticBucket = new s3.Bucket(this, 'static-bucket', {
publicReadAccess: true,
websiteIndexDocument: 'index.html'
});
// Create an ECS cluster
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
// An SNS topic to which we can publish to trigger the crawl of a changelog
const toCrawlTopic = new sns.Topic(this, 'to-crawl', {
displayName: 'Changelog to crawl'
});
const redisCluster = new redis.Cluster(this, 'redis', { vpc });
this.vpc = vpc;
this.changelogsTable = changelogsTable;
this.feedsTable = feedsTable;
this.searchIndexTable = searchIndexTable;
this.webBucket = webBucket;
this.apiBucket = apiBucket;
this.staticBucket = staticBucket;
this.toCrawlTopic = toCrawlTopic;
this.cluster = cluster;
this.redis = redisCluster;
}
constructor(parent, id) {
super(parent, id);
new sns.Topic(this, 'topic1');
new sns.Topic(this, 'topic2');
}
}
constructor(parent, id) {
super(parent, id);
new sns.Topic(this, 'topic');
new cdk.AvailabilityZoneProvider(this).availabilityZones;
new cdk.SSMParameterProvider(this, { parameterName: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2' }).parameterValue('');
}
}
};
const approvalRequester = new Function(
scope,
'SlackApprovalRequesterFunction',
{
runtime: Runtime.NODEJS_10_X,
handler: 'lib/approval-requester.handler',
code: Code.asset(
path.join(__dirname, '..', 'lambda', 'bundle.zip'),
),
environment,
},
);
const topic = new Topic(scope, 'SlackApprovalTopic');
topic.grantPublish(options.role);
topic.addSubscription(new LambdaSubscription(approvalRequester));
const approvalHandler = new Function(
scope,
'SlackApprovalHandlerFunction',
{
runtime: Runtime.NODEJS_10_X,
handler: 'lib/approval-handler.handler',
code: Code.fromAsset(
path.join(__dirname, '..', 'lambda', 'bundle.zip'),
),
environment,
},
);
public bind(scope: Construct, lifecycleHook: autoscaling.ILifecycleHook): autoscaling.LifecycleHookTargetConfig {
const topic = new sns.Topic(scope, 'Topic');
topic.addSubscription(new subs.LambdaSubscription(this.fn));
return new TopicHook(topic).bind(scope, lifecycleHook);
}
}