Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Commit

Permalink
docs: Fix scope reference
Browse files Browse the repository at this point in the history
  • Loading branch information
setu4993 committed Dec 30, 2021
1 parent bc17ce4 commit 7376188
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/@aws-cdk/aws-lambda-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Additional build args for bundling that refer to PyPI indexes can be specified a
const entry = '/path/to/function';
const image = DockerImage.fromBuild(entry);

new PythonFunction(stack, 'function', {
new PythonFunction(this, 'function', {
entry,
runtime: Runtime.PYTHON_3_8,
bundling: {
Expand Down Expand Up @@ -153,11 +153,12 @@ const image = DockerImage.fromBuild(entry);

const domain = 'my-domain';
const domainOwner = '111122223333';
const repoName = 'my_repo';
const codeArtifactAuthToken = execSync(`aws codeartifact get-authorization-token --domain ${domain} --domain-owner ${domainOwner} --query authorizationToken --output text`).toString().trim();

const indexUrl = `https://aws:${codeArtifactAuthToken}@${domain}-${domainOwner}.d.codeartifact.${stack.env?.region}.amazonaws.com/pypi/my_repo/simple/`;
const indexUrl = `https://aws:${codeArtifactAuthToken}@${domain}-${domainOwner}.d.codeartifact.${this.stack.env?.region}.amazonaws.com/pypi/${repoName}/simple/`;

new PythonFunction(stack, 'function', {
new PythonFunction(this, 'function', {
entry,
runtime: Runtime.PYTHON_3_8,
bundling: {
Expand Down

0 comments on commit 7376188

Please sign in to comment.