Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
chore: sync w gitfarm (#1229)
Browse files Browse the repository at this point in the history
* sync w Gitfarm
  • Loading branch information
SanketD92 authored Oct 16, 2023
1 parent fd549cf commit 5d473c5
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .crux_dry_run_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
AUTOBUILD

Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,29 @@ Resources:
SecurityGroupIds:
- !Ref InterfaceEndpointSecurityGroup

EC2Endpoint:
Type: 'AWS::EC2::VPCEndpoint'
Condition: isAppStream
Properties:
PolicyDocument:
Version: 2012-10-17
Statement:
- Sid: AllowPrefixListDescription
Effect: Allow
Principal: '*'
Action:
- 'ec2:DescribeManagedPrefixLists'
- 'ec2:DescribePrefixLists'
Resource: '*'
SubnetIds:
- !Ref PrivateWorkspaceSubnet
VpcEndpointType: Interface
PrivateDnsEnabled: true
ServiceName: !Sub 'com.amazonaws.${AWS::Region}.ec2'
VpcId: !Ref VPC
SecurityGroupIds:
- !Ref InterfaceEndpointSecurityGroup

CfnEndpoint:
Type: 'AWS::EC2::VPCEndpoint'
Condition: isAppStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ async function onStudyRegistration(payload) {
const studyEntityUpdated = await studyService.update(systemContext, { id: studyEntity.id, appRoleArn: appRole.arn });

const vpcePolicyService = await container.find('roles-only/vpcePolicyService');
const ec2Client = await vpcePolicyService.getEc2ServiceForStudy(systemContext, studyEntity);

const { accountId, region } = studyEntity;

// Dynamically add the BYOB fs role to the STS VPCE Policy
const stsVpceId = await vpcePolicyService.getVpceIdFromStudy(systemContext, studyEntity, 'STS');

// null means this is not appstream enabled therefore these steps can be skipped.
if (stsVpceId !== null) {
const ec2Client = await vpcePolicyService.getEc2ServiceForStudy(systemContext, studyEntity);

const { accountId, region } = studyEntity;

const roleArn = `arn:aws:iam::${accountId}:role/swb-*-fs-*`;
await vpcePolicyService.addRoleToStsVpcePolicy(ec2Client, roleArn, stsVpceId, 'AllowAssumeRole');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ phases:
install:
# See supported runtimes at https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
runtime-versions:
nodejs: 12
nodejs: 14

build:
commands:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 0.2
phases:
install:
runtime-versions:
nodejs: 12
nodejs: 14

pre_build:
commands:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ phases:
install:
# See supported runtimes at https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
runtime-versions:
nodejs: 12
nodejs: 14

pre_build:
commands:
Expand Down
3 changes: 1 addition & 2 deletions main/cicd/cicd-pipeline/config/buildspec/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ phases:
install:
# See supported runtimes at https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
runtime-versions:
nodejs: 12
golang: 1.13
nodejs: 14

pre_build:
commands:
Expand Down
12 changes: 6 additions & 6 deletions main/cicd/cicd-pipeline/config/infra/cloudformation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ Resources:
Environment:
ComputeType: BUILD_GENERAL1_LARGE
Type: LINUX_CONTAINER
Image: aws/codebuild/amazonlinux2-x86_64-standard:2.0
Image: aws/codebuild/standard:5.0
EnvironmentVariables:
- Name: DEPLOYMENT_BUCKET
Value: ${self:provider.deploymentBucket.name}
Expand Down Expand Up @@ -844,7 +844,7 @@ Resources:
Environment:
ComputeType: BUILD_GENERAL1_LARGE
Type: LINUX_CONTAINER
Image: aws/codebuild/amazonlinux2-x86_64-standard:2.0
Image: aws/codebuild/standard:5.0
EnvironmentVariables:
- Name: DEPLOYMENT_BUCKET
Value: ${self:provider.deploymentBucket.name}
Expand All @@ -871,7 +871,7 @@ Resources:
Environment:
ComputeType: BUILD_GENERAL1_LARGE
Type: LINUX_CONTAINER
Image: aws/codebuild/amazonlinux2-x86_64-standard:2.0
Image: aws/codebuild/standard:5.0
EnvironmentVariables:
- Name: DEPLOYMENT_BUCKET
Value: ${self:provider.deploymentBucket.name}
Expand All @@ -898,7 +898,7 @@ Resources:
Environment:
ComputeType: BUILD_GENERAL1_LARGE
Type: LINUX_CONTAINER
Image: aws/codebuild/amazonlinux2-x86_64-standard:2.0
Image: aws/codebuild/standard:5.0
EnvironmentVariables:
- Name: DEPLOYMENT_BUCKET
Value: ${self:provider.deploymentBucket.name}
Expand Down Expand Up @@ -926,7 +926,7 @@ Resources:
Environment:
ComputeType: BUILD_GENERAL1_LARGE
Type: LINUX_CONTAINER
Image: aws/codebuild/amazonlinux2-x86_64-standard:2.0
Image: aws/codebuild/standard:5.0
EnvironmentVariables:
- Name: DEPLOYMENT_BUCKET
Value: ${self:provider.deploymentBucket.name}
Expand All @@ -953,7 +953,7 @@ Resources:
Environment:
ComputeType: BUILD_GENERAL1_LARGE
Type: LINUX_CONTAINER
Image: aws/codebuild/amazonlinux2-x86_64-standard:2.0
Image: aws/codebuild/standard:5.0
ServiceRole: !GetAtt AppDeployerRole.Arn
QueuedTimeoutInMinutes: 180
TimeoutInMinutes: 90
Expand Down
2 changes: 1 addition & 1 deletion scripts/app-stream/start-image-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const StartImageBuilder = class StartImageBuilder {
this.imageBuilderName = `SWBImageBuilder-${Date.now()}`;
this.imageName =
imageName === "default"
? "AppStream-WinServer2019-07-12-2022"
? "AppStream-WinServer2019-06-12-2023"
: imageName;
this.imageSize =
imageSize === "default" ? "stream.standard.medium" : imageSize;
Expand Down

0 comments on commit 5d473c5

Please sign in to comment.