Other tidying up

This commit is contained in:
Alex Hung
2021-02-24 11:34:27 -08:00
parent f41fbb3913
commit 14dcf41a46
2 changed files with 13 additions and 21 deletions

View File

@@ -386,7 +386,7 @@ Resources:
ArtifactoryCoreInfraStack: ArtifactoryCoreInfraStack:
Type: AWS::CloudFormation::Stack Type: AWS::CloudFormation::Stack
Properties: Properties:
TemplateURL: https://jfrog-marketplace-test-us-east-1.s3.amazonaws.com/marketplace-jfrog-artifactory/templates/jfrog-artifactory-core-infrastructure.template.yaml TemplateURL: https://jfrog-marketplace-test-us-east-1.s3.amazonaws.com/marketplace-jfrog-artifactory/v7153/templates/jfrog-artifactory-core-infrastructure.template.yaml
Parameters: Parameters:
AvailabilityZones: AvailabilityZones:
Fn::Join: Fn::Join:
@@ -500,7 +500,7 @@ Resources:
Tags: Tags:
- Key: Name - Key: Name
Value: !Sub ${ArtifactoryProduct}-ec2-instances-sg Value: !Sub ${ArtifactoryProduct}-ec2-instances-sg
GroupDescription: SG for EC2 instances (also permits access using SSH from the bastion host) GroupDescription: SG for EC2 instances
VpcId: !Ref VpcId VpcId: !Ref VpcId
SecurityGroupIngress: SecurityGroupIngress:
- IpProtocol: tcp - IpProtocol: tcp
@@ -579,21 +579,17 @@ Resources:
- "logs:CreateLogStream" - "logs:CreateLogStream"
- "logs:PutLogEvents" - "logs:PutLogEvents"
- "logs:DescribeLogStreams" - "logs:DescribeLogStreams"
Resource: "arn:aws:logs:*:*:*" Resource: !Sub "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:*:*"
- Effect: "Allow" - PolicyName: 'SecretsManager-policy'
Action:
- "s3:GetObject"
Resource: "*"
- PolicyName: 'SecretsMaanger-policy'
PolicyDocument: PolicyDocument:
Version: "2012-10-17" Version: "2012-10-17"
Statement: Statement:
- Effect: "Allow" - Effect: "Allow"
Action: Action:
- "secretsmanager:GetSecretValue" - "secretsmanager:GetSecretValue"
Resource: "arn:aws:secretsmanager:*:*:secret:*" Resource: !Sub "arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:*"
ArtifactoryHostProfile: ArtifactoryHostProfile:
Type: 'AWS::IAM::InstanceProfile' Type: AWS::IAM::InstanceProfile
Properties: Properties:
Roles: Roles:
- !Ref ArtifactoryHostRole - !Ref ArtifactoryHostRole
@@ -601,11 +597,11 @@ Resources:
ArtifactoryPrimary: ArtifactoryPrimary:
Type: AWS::CloudFormation::Stack Type: AWS::CloudFormation::Stack
Properties: Properties:
TemplateURL: https://jfrog-marketplace-test-us-east-1.s3.amazonaws.com/marketplace-jfrog-artifactory/templates/jfrog-artifactory-ec2-instance.template.yaml TemplateURL: https://jfrog-marketplace-test-us-east-1.s3.amazonaws.com/marketplace-jfrog-artifactory/v7153/templates/jfrog-artifactory-ec2-instance.template.yaml
Parameters: Parameters:
PrivateSubnetIds: !Join [',', [!Ref PrivateSubnet1Id]] PrivateSubnetIds: !Join [',', [!Ref PrivateSubnet1Id]]
MinScalingNodes: '1' # Always have 1 MasterNode MinScalingNodes: '1' # Always have 1 Primary Node
MaxScalingNodes: '1' # Always have 1 MasterNode MaxScalingNodes: '1' # Always have 1 Primary Node
DeploymentTag: !If [IsArtifactory, "ArtifactoryPrimary", "JcrPrimary"] DeploymentTag: !If [IsArtifactory, "ArtifactoryPrimary", "JcrPrimary"]
HostRole: !Ref ArtifactoryHostRole HostRole: !Ref ArtifactoryHostRole
ArtifactoryProduct: !Ref ArtifactoryProduct ArtifactoryProduct: !Ref ArtifactoryProduct
@@ -643,7 +639,7 @@ Resources:
DependsOn: ArtifactoryPrimary DependsOn: ArtifactoryPrimary
Type: AWS::CloudFormation::Stack Type: AWS::CloudFormation::Stack
Properties: Properties:
TemplateURL: https://jfrog-marketplace-test-us-east-1.s3.amazonaws.com/marketplace-jfrog-artifactory/templates/jfrog-artifactory-ec2-instance.template.yaml TemplateURL: https://jfrog-marketplace-test-us-east-1.s3.amazonaws.com/marketplace-jfrog-artifactory/v7153/templates/jfrog-artifactory-ec2-instance.template.yaml
Parameters: Parameters:
PrivateSubnetIds: !Join [',', [!Ref PrivateSubnet1Id, !Ref PrivateSubnet2Id]] PrivateSubnetIds: !Join [',', [!Ref PrivateSubnet1Id, !Ref PrivateSubnet2Id]]
MinScalingNodes: !Ref NumberOfSecondary MinScalingNodes: !Ref NumberOfSecondary
@@ -725,11 +721,7 @@ Resources:
- "logs:CreateLogStream" - "logs:CreateLogStream"
- "logs:PutLogEvents" - "logs:PutLogEvents"
- "logs:DescribeLogStreams" - "logs:DescribeLogStreams"
Resource: "arn:aws:logs:*:*:*" Resource: !Sub "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:*:*"
- Effect: "Allow"
Action:
- "s3:GetObject"
Resource: "*"
XrayHostProfile: XrayHostProfile:
Condition: EnableXray Condition: EnableXray
Type: 'AWS::IAM::InstanceProfile' Type: 'AWS::IAM::InstanceProfile'
@@ -742,7 +734,7 @@ Resources:
DependsOn: ArtifactoryPrimary DependsOn: ArtifactoryPrimary
Type: AWS::CloudFormation::Stack Type: AWS::CloudFormation::Stack
Properties: Properties:
TemplateURL: https://jfrog-marketplace-test-us-east-1.s3.amazonaws.com/marketplace-jfrog-artifactory/templates/jfrog-xray-ec2-instance.template.yaml TemplateURL: https://jfrog-marketplace-test-us-east-1.s3.amazonaws.com/marketplace-jfrog-artifactory/v7153/templates/jfrog-xray-ec2-instance.template.yaml
Parameters: Parameters:
PrivateSubnet1Id: !Ref PrivateSubnet1Id PrivateSubnet1Id: !Ref PrivateSubnet1Id
PrivateSubnet2Id: !Ref PrivateSubnet2Id PrivateSubnet2Id: !Ref PrivateSubnet2Id

View File

@@ -182,7 +182,7 @@ Resources:
IamInstanceProfile: !Ref XrayHostProfile IamInstanceProfile: !Ref XrayHostProfile
ImageId: !FindInMap ImageId: !FindInMap
- AWSAMIRegionMap - AWSAMIRegionMap
- !Ref 'AWS::Region' - !Ref AWS::Region
- !Ref XrayAmiId - !Ref XrayAmiId
SecurityGroups: SecurityGroups:
- !Ref SecurityGroups - !Ref SecurityGroups