/node_modules/aws-cdk-lib/core/lib/stack.ts:395
throw new Error('${target.node.path}' depends on '${this.node.path}' (${cycle.join(', ')}). Adding this dependency (${reason}) would create a cyclic reference.);
There are no 'Private' subnet groups in this VPC. Available types: Isolated,Public
Is there a workaround to deploying to 'Private' subnets that do not have NAT gateways?
Trying to lookup a subdomain and use if found, and create if not found using Typescript. I am a little confused as to how the relationship between HostedZone.fromLookup
, the env
var, and context
work together. I am passing an env
object into the stack with my region and account number. When I use a knowingly incorrect subdomain I get Found zones: [] for dns:lies.example.com ....
which makes sense. However when I try to log some value I get DUMMY
so I know that the cli is trying to fill those in later per the docs. I assume the real value is looked up at deploy time, and that is when it is added to context.cdk.json
?
Is there some method I am missing to do if HostedZone
exists, and if not create it?
"dependencies": {
"@aws-cdk/aws-ecr-assets": "^1.144.0",
"@aws-cdk/aws-lambda": "^1.144.0",
"@aws-cdk/aws-sns": "^1.144.0",
"@aws-cdk/aws-sns-subscriptions": "^1.144.0",
"@aws-cdk/aws-sqs": "^1.144.0",
"aws-cdk-lib": "2.12.0",
"constructs": "^10.0.63",
"source-map-support": "^0.5.21"
}
with code
export class Wrk2LambdaStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const queue = new sqs.Queue(this, 'wrk2-queue');
const topic = new sns.Topic(this, "")
gives
TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'. Type 'Wrk2LambdaStack' is not assignable to type 'Construct'. Property 'onValidate' is protected but type 'Construct' is not a class derived from 'Construct'.
import * as cdk from '@aws-cdk/core';
import * as iam from '@aws-cdk/aws-iam';
import * as lambda from '@aws-cdk/aws-lambda';
import * as s3 from '@aws-cdk/aws-s3';
import * as sqs from '@aws-cdk/aws-sqs';
import * as sns from '@aws-cdk/aws-sns';
├── @aws-cdk/aws-ecr-assets@1.144.0
├── @aws-cdk/aws-lambda@1.144.0
├── @aws-cdk/aws-sns-subscriptions@1.144.0
├── @aws-cdk/aws-sns@1.144.0
├── @aws-cdk/aws-sqs@1.144.0
├── @types/jest@27.4.0
├── @types/node@17.0.18
├── aws-cdk-lib@2.12.0
├── aws-cdk@2.12.0
├── constructs@10.0.63
├── jest@27.5.1
├── source-map-support@0.5.21
├── ts-jest@27.1.3
├── ts-node@10.5.0
└── typescript@4.5.5
Hi.
I try to deploy an AWS lambda (multiple AWS lambdas) with AWS CDK.
Everything works fine when i don't have node modules.
I want to add winston lib to manage logs now.
So I added it to package.json.
I Added in the cdk part:
bundling: {
nodeModules: ['winston']
}
And I do npm install in my gitlab CI before cdk bootstrap.
And I get this error:
npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR!
npm ERR!
npm ERR! Missing: winston@^3.7.2
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/_logs/2022-05-02T19_19_34_562Z-debug.log
Hi, I have find the way to change ENUM value with variable.
From
const alarm = new Alarm(this, `${params.alarm.name}-Alarm`, {
metric,
threshold: params.alarm.threshold,
comparisonOperator: ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD,
});
To
const alarm = new Alarm(this, `${params.alarm.name}-Alarm`, {
metric,
threshold: params.alarm.threshold,
comparisonOperator: ComparisonOperator.*variable
});
Trying to stand up some DNS servers in Fargate containers. When I define a UDP container, I get the following message:
Container 'AuthDNSApplicationStack/TaskDefUDP/ContainerUDP' has no mapping for port undefined and protocol tcp. Did you call "container.addPortMappings()"?
Code:
const containerUDP = taskDefUDP.addContainer('ContainerUDP', {
image: ContainerImage.fromEcrRepository(repository),
environment: {
"AWS_ENVIRONMENT": awsEnvironmentString,
"SLACK_WEBHOOK": assets.slackWebhook,
},
logging: LogDrivers.awsLogs({
logGroup: assets.dnsLogGroup,
streamPrefix: 'dns',
})
});
containerUDP.addPortMappings({containerPort: 53, protocol: ecsProtocol.UDP})
Hello, can anyone help me out with advanced CDK testing in python, please?
I have an EC2 instance which I want to test that it is in a private subnet.
This is the resolved stack part:
"SubnetId": {
"Ref": "testvpcPrivateSubnet1Subnet865FB50A"
},
Testing it with: ...
assert template.has_resource_properties(
"AWS::EC2::Instance", {"SubnetId": {"Ref": "testvpcPrivateSubnet1Subnet865FB50A"}}
)
gives me no match at all. What I am doing wrong?