-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aws-codebuild): add ProjectFileSystemLocation property to codebu…
…ild (#6539) * add ProjectFileSystemLocation to codebuild * update readme * future proof as suggested in #6539 * fix from review #6539 (review) * Update packages/@aws-cdk/aws-codebuild/lib/project.ts Co-Authored-By: Adam Ruka <[email protected]> * fix review #6539 (review) * fix review https://github.com/aws/aws-cdk/pull/6539/files/1f7972d2567abd1eeb55334c7a8f5d6968daf4b6#pullrequestreview-380798922 * fix review https://github.com/aws/aws-cdk/pull/6539/files/1f7972d2567abd1eeb55334c7a8f5d6968daf4b6#pullrequestreview-380798922 Co-authored-by: Adam Ruka <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9374642
commit 2195cc2
Showing
7 changed files
with
698 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { Construct } from '@aws-cdk/core'; | ||
import { CfnProject } from './codebuild.generated'; | ||
import { IProject } from './project'; | ||
|
||
/** | ||
* The type returned from {@link IFileSystemLocation#bind}. | ||
*/ | ||
export interface FileSystemConfig { | ||
/** | ||
* File system location wrapper property. | ||
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html | ||
*/ | ||
readonly location: CfnProject.ProjectFileSystemLocationProperty; | ||
} | ||
|
||
/** | ||
* The interface of a CodeBuild FileSystemLocation. | ||
* Implemented by {@link EfsFileSystemLocation}. | ||
*/ | ||
export interface IFileSystemLocation { | ||
/** | ||
* Called by the project when a file system is added so it can perform | ||
* binding operations on this file system location. | ||
*/ | ||
bind(scope: Construct, project: IProject): FileSystemConfig; | ||
} | ||
|
||
/** | ||
* FileSystemLocation provider definition for a CodeBuild Project. | ||
*/ | ||
export class FileSystemLocation { | ||
/** | ||
* EFS file system provider. | ||
* @param props the EFS File System location property. | ||
*/ | ||
public static efs(props: EfsFileSystemLocationProps): IFileSystemLocation { | ||
return new EfsFileSystemLocation(props); | ||
} | ||
} | ||
|
||
/** | ||
* EfsFileSystemLocation definition for a CodeBuild project. | ||
*/ | ||
class EfsFileSystemLocation implements IFileSystemLocation { | ||
constructor(private readonly props: EfsFileSystemLocationProps) {} | ||
|
||
public bind(_scope: Construct, _project: IProject): FileSystemConfig { | ||
return { | ||
location: { | ||
identifier: this.props.identifier, | ||
location: this.props.location, | ||
mountOptions: this.props.mountOptions, | ||
mountPoint: this.props.mountPoint, | ||
type: 'EFS', | ||
}, | ||
}; | ||
} | ||
} | ||
|
||
/** | ||
* Construction properties for {@link EfsFileSystemLocation}. | ||
*/ | ||
export interface EfsFileSystemLocationProps { | ||
/** | ||
* The name used to access a file system created by Amazon EFS. | ||
*/ | ||
readonly identifier: string; | ||
|
||
/** | ||
* A string that specifies the location of the file system, like Amazon EFS. | ||
* @example 'fs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory'. | ||
*/ | ||
readonly location: string; | ||
|
||
/** | ||
* The mount options for a file system such as Amazon EFS. | ||
* @default 'nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2'. | ||
*/ | ||
readonly mountOptions?: string; | ||
|
||
/** | ||
* The location in the container where you mount the file system. | ||
*/ | ||
readonly mountPoint: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.