question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[docs] App construct does not show "construction properties", first section is "member properties" and is easy to misinterpret

See original GitHub issue

I’m trying to set my account and region at the App level so that all my stacks inherit from it as in the docs. However, when I log the instantiated App, account and region are undefined. In the source, it seems that the props are unsupported.

At minimum, the docs are out of date. However…

I’m pulling account and region from the CDK env vars (CDK_DEFAULT_ACCOUNT, CDK_DEFAULT_REGION). So even if App no longer supports setting them, my stacks should be picking them up anyway. Yet I get the following error:

Error: Cannot retrieve value from context provider hosted-zone since account/region are not specified at the stack level. Either configure "env" with explicit account and region when you define your stack, or use the environment variables "CDK_DEFAULT_ACCOUNT" and "CDK_DEFAULT_REGION" to inherit environment information from the CLI (not recommended for production stacks)

I’m going back to configuring on the Stack-level, but I figured this still warrants looking into.

Reproduction Steps

import {App, Stack} from '@aws-cdk/core';

const account = process.env.CDK_DEFAULT_ACCOUNT;
const region = process.env.CDK_DEFAULT_REGION;

const app = new App({account, region});
const stack = new Stack(app, 'Stack', {});

console.log({account, region}); // { account: '215531866295', region: 'us-east-1' }

Environment

  • CLI Version : 1.60.0
  • Framework Version: 1.60.0
  • Node.js Version: 14.8.0
  • OS : OSX
  • Language (Version): JS

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rix0rrrcommented, Sep 3, 2020

Neta was right and I’m wrong. I fell into the same trap as the original poster, mistaking the set of “member properties” for a set of “construction properties”.

Normally a construct renders the construction properties as the first table but not for App since it’s the only construct that doesn’t follow the standard construct signature of (scope, id, props).

This is a docs problem: App should show the table of construction properties, and the fact that both sets of properties are called “properties” doesn’t help AT ALL

0reactions
github-actions[bot]commented, Jun 3, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Google Docs, Sheets, Slides & Forms error ...
If you urgently need to access a file and resume your progress, you can ... Troubleshoot error message: “Sorry, the file you have...
Read more >
THE GENERAL PROPERTY TAX ACT Act 206 of 1893 AN ...
AN ACT to provide for the assessment of rights and interests, including leasehold interests, in property and the levy and collection of taxes...
Read more >
Whiteness as Property - JSTOR
THE CONSTRUCTION OF RACE AND THE EMERGENCE OF WHITENESS AS. PROPERTY . ... this discussion by positing that racial identity and property are...
Read more >
B2 User Manual - 1.81.0 - Boost C++ Libraries
A complete description of features can be found in the section called “Features and properties”. 3.2.1. Build Requests and Target Requirements. The set...
Read more >
Building Department - Benton County, Washington
1. Complete attached building application form. Tax parcel number can be obtained from the property tax statement or from Assessor's office. All plumbing/ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found