Skip to content

Commit 994d3c3

Browse files
authored
fix(codebuild): Project.addFileSystemLocation does not work without providing locations at construction (#10460)
Fixes #10442 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 13e7bde commit 994d3c3

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

packages/@aws-cdk/aws-codebuild/lib/project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ export class Project extends ProjectBase {
751751
artifacts: artifactsConfig.artifactsProperty,
752752
serviceRole: this.role.roleArn,
753753
environment: this.renderEnvironment(props.environment, environmentVariables),
754-
fileSystemLocations: this.renderFileSystemLocations(),
754+
fileSystemLocations: Lazy.anyValue({ produce: () => this.renderFileSystemLocations() }),
755755
// lazy, because we have a setter for it in setEncryptionKey
756756
encryptionKey: Lazy.stringValue({ produce: () => this._encryptionKey && this._encryptionKey.keyArn }),
757757
badgeEnabled: props.badge,

packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts

-13
Original file line numberDiff line numberDiff line change
@@ -1036,12 +1036,6 @@ export = {
10361036
buildSpec: codebuild.BuildSpec.fromObject({
10371037
version: '0.2',
10381038
}),
1039-
fileSystemLocations: [codebuild.FileSystemLocation.efs({
1040-
identifier: 'myidentifier2',
1041-
location: 'myclodation.mydnsroot.com:/loc',
1042-
mountPoint: '/media',
1043-
mountOptions: 'opts',
1044-
})],
10451039
});
10461040
project.addFileSystemLocation(codebuild.FileSystemLocation.efs({
10471041
identifier: 'myidentifier3',
@@ -1052,13 +1046,6 @@ export = {
10521046

10531047
expect(stack).to(haveResourceLike('AWS::CodeBuild::Project', {
10541048
'FileSystemLocations': [
1055-
{
1056-
'Identifier': 'myidentifier2',
1057-
'MountPoint': '/media',
1058-
'MountOptions': 'opts',
1059-
'Location': 'myclodation.mydnsroot.com:/loc',
1060-
'Type': 'EFS',
1061-
},
10621049
{
10631050
'Identifier': 'myidentifier3',
10641051
'MountPoint': '/media',

0 commit comments

Comments
 (0)