Replies: 13 comments 5 replies
-
OK, it's not this. const vpc = Vpc.fromLookup(this, 'Vpc', {
vpcId: props.vpcId,
}) I figured out the only reason that was there was to be able to create a security group, and I could do this instead of actually looking up the VPC. const sg = new SecurityGroup(this, 'SG', {
securityGroupName: `foo`,
description: `foo`,
vpc: { vpcId: props.vpcId } as Vpc,
}) But I'm still getting the same error. |
Beta Was this translation helpful? Give feedback.
-
It's not ssm.StringParameter.valueForStringParameter(this, props.parentImagePath) either... |
Beta Was this translation helpful? Give feedback.
-
It's not kms.Alias.fromAliasName(this, 'snsKeyAlias', 'alias/foo') either... |
Beta Was this translation helpful? Give feedback.
-
Minimal stack that still fails import { Stack, StackProps } from 'aws-cdk-lib'
import { Construct } from 'constructs'
import { Topic } from 'aws-cdk-lib/aws-sns'
export interface TestStackProps extends StackProps {
readonly stage: string
}
export class TestStack extends Stack {
constructor(scope: Construct, id: string, props: TestStackProps) {
super(scope, id, props)
new Topic(this, 'AlarmNotificationTopic', {})
}
} |
Beta Was this translation helpful? Give feedback.
-
my #!/usr/bin/env node
import 'source-map-support/register'
import * as cdk from 'aws-cdk-lib'
import { TestStack } from '../lib/test-stack'
const app = new cdk.App()
new TestStack(app, 'TestStackTest', {
env: { account: '46xxx', region: 'us-east-1' },
stage: 'test',
}) |
Beta Was this translation helpful? Give feedback.
-
Hey @kabo, I'm not sure we ever claim to support these environment variables - Have you checked out our guide on setting up credentials? |
Beta Was this translation helpful? Give feedback.
-
It's working fine in lots of other repos, it's just this one that's acting weird for some unknown reason. I've also tried clearing cdk.context.json. Do you think clearing cdk.json could help? Wondering if there's some state somewhere that's wonky and causing these issues... |
Beta Was this translation helpful? Give feedback.
-
What exactly do you mean by this, can you use these environment variables in other CDK projects? |
Beta Was this translation helpful? Give feedback.
-
Exactly. |
Beta Was this translation helpful? Give feedback.
-
Ok so I was mistaken, we do support these ENV variables. TIL! If it normally works and it's not now then I'm honestly not too sure what might be going on here... I'll try to look into this some more |
Beta Was this translation helpful? Give feedback.
-
OK, I figured it out. export AWS_DEFAULT_REGION=eu-west-1 If I instead change that to export AWS_REGION=eu-west-1 it works! Even though I've set the region I want to use in my So the CDK requires that one sets |
Beta Was this translation helpful? Give feedback.
-
Closing this discussion in favor of #25082 |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What is the problem?
CDK seems to try to do something in the account, but fails because it can't find the credentials.
We're deploying from a bitbucket pipeline using AWS_ROLE_ARN/AWS_WEB_IDENTITY_TOKEN_FILE.
The AWS CLI can use the credentials.
Reproduction Steps
I suspect this has to do with
but I'm not sure.
What did you expect to happen?
The deploy to work as normal
What actually happened?
CDK CLI Version
2.18.0
Framework Version
No response
Node.js Version
14
OS
Alpine
Language
Typescript
Language Version
No response
Other information
No response
Beta Was this translation helpful? Give feedback.
All reactions