Skip to content

Commit

Permalink
docs(assets): tarball path should be absolute (#15750)
Browse files Browse the repository at this point in the history
Improve docs to indicate that the path to a tarball should be absolute and not relative.

Fixes #15721 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Elad Ben-Israel authored Sep 12, 2021
1 parent 7229ad2 commit a732078
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/@aws-cdk/aws-ecr-assets/lib/tarball-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import { Construct as CoreConstruct } from '@aws-cdk/core';
*/
export interface TarballImageAssetProps {
/**
* Path to the tarball.
* Absolute path to the tarball.
*
* It is recommended to to use the script running directory (e.g. `__dirname`
* in Node.js projects or dirname of `__file__` in Python) if your tarball
* is located as a resource inside your project.
*/
readonly tarballFile: string;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-ecs/lib/container-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export abstract class ContainerImage {
* Use this method if the container image has already been created by another process (e.g. jib)
* and you want to add it as a container image asset.
*
* @param tarballFile Path to the tarball (relative to the directory).
* @param tarballFile Absolute path to the tarball. You can use language-specific idioms (such as `__dirname` in Node.js)
* to create an absolute path based on the current script running directory.
*/
public static fromTarball(tarballFile: string): ContainerImage {
return {
Expand Down

0 comments on commit a732078

Please sign in to comment.