Skip to content

Commit

Permalink
Merge pull request #16 from monte-carlo-data/pchawla/mes-361-add-a-bu…
Browse files Browse the repository at this point in the history
…tton-to-launch-nested-stack-for-aws-networking-agent

Move sample into templates to enable quick creation links
  • Loading branch information
pxc-dev authored Jul 8, 2024
2 parents a948af7 + fb18576 commit 33fbc19
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 71 deletions.
65 changes: 2 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,69 +35,8 @@ a data store on AWS.
This template creates a VPC with 2 public and private subnets. Includes a NAT, IGW, and S3 VPCE.
Can be used to connect an Agent to a VPC for peering and/or IP whitelisting.

The following example demonstrates how you can deploy an agent with this connected VPC in one stack:

```yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: Example template that deploys an agent with a connected VPC by leveraging nested stacks.
Parameters:
CloudAccountId:
Description: >
Select the Monte Carlo account your collection service is hosted in. This can be found in the
'settings/integrations/collectors' tab on the UI or via the 'montecarlo collectors list' command on the CLI.
Type: String
Default: 590183797493
AllowedValues: [ 190812797848, 799135046351, 682816785079, 637423407294, 590183797493 ]
ConcurrentExecutions:
Default: 20
Description: The number of concurrent lambda executions for the agent.
MaxValue: 200
MinValue: 0
Type: Number
ImageUri:
Default: 590183797493.dkr.ecr.*.amazonaws.com/mcd-agent:latest
Description: >
URI of the Agent container image (ECR Repo). Note that the region automatically maps to where this stack
is deployed in.
Type: String
MemorySize:
Default: 512
Description: >
The amount of memory (MB) available to the agent at runtime; this value can be any multiple of
1 MB greater than 256MB.
MinValue: 256
MaxValue: 10240
Type: Number
Outputs:
FunctionArn:
Description: Agent Function ARN. To be used in registering.
Value: !GetAtt Agent.Outputs.FunctionArn
InvocationRoleArn:
Description: Assumable role ARN. To be used in registering.
Value: !GetAtt Agent.Outputs.InvocationRoleArn
InvocationRoleExternalId:
Description: Assumable role External ID. To be used in registering.
Value: !GetAtt Agent.Outputs.InvocationRoleExternalId
PublicIP:
Description: IP address from which agent resources access the Internet (e.g. for IP whitelisting).
Value: !GetAtt Networking.Outputs.PublicIP
Resources:
Networking:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://mcd-public-resources.s3.amazonaws.com/cloudformation/basic_vpc.yaml
Agent:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://mcd-public-resources.s3.amazonaws.com/cloudformation/aws_apollo_agent.yaml
Parameters:
CloudAccountId: !Ref CloudAccountId
ConcurrentExecutions: !Ref ConcurrentExecutions
ExistingVpcId: !GetAtt Networking.Outputs.VpcId
ExistingSubnetIds: !Join [ ',', [ !GetAtt Networking.Outputs.PrivateSubnetAz1, !GetAtt Networking.Outputs.PrivateSubnetAz2 ] ]
ImageUri: !Ref ImageUri
MemorySize: !Ref MemorySize
```
This [example](templates/cloudformation/aws_agent_with_basic_vpc.yaml) demonstrates how you can deploy an agent with
this connected VPC in one stack.

### Terraform

Expand Down
60 changes: 60 additions & 0 deletions templates/cloudformation/aws_agent_with_basic_vpc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
AWSTemplateFormatVersion: '2010-09-09'
Description: Sample template that deploys an agent with a connected VPC by leveraging nested stacks.
Parameters:
CloudAccountId:
Description: >
For deployments on the V2 Platform, use 590183797493. Accounts created after April 24th, 2024,
will automatically be on the V2 platform or newer. If you are using an older version of the platform,
please contact your Monte Carlo representative for the ID.
Type: String
Default: 590183797493
AllowedValues: [ 190812797848, 799135046351, 682816785079, 637423407294, 590183797493 ]
ConcurrentExecutions:
Default: 20
Description: The number of concurrent lambda executions for the agent.
MaxValue: 200
MinValue: 0
Type: Number
ImageUri:
Default: 590183797493.dkr.ecr.*.amazonaws.com/mcd-agent:latest
Description: >
URI of the Agent container image (ECR Repo). Note that the region automatically maps to where this stack
is deployed in.
Type: String
MemorySize:
Default: 512
Description: >
The amount of memory (MB) available to the agent at runtime; this value can be any multiple of
1 MB greater than 256MB.
MinValue: 256
MaxValue: 10240
Type: Number
Outputs:
FunctionArn:
Description: Agent Function ARN. To be used in registering.
Value: !GetAtt Agent.Outputs.FunctionArn
InvocationRoleArn:
Description: Assumable role ARN. To be used in registering.
Value: !GetAtt Agent.Outputs.InvocationRoleArn
InvocationRoleExternalId:
Description: Assumable role External ID. To be used in registering.
Value: !GetAtt Agent.Outputs.InvocationRoleExternalId
PublicIP:
Description: IP address from which agent resources access the Internet (e.g. for IP whitelisting).
Value: !GetAtt Networking.Outputs.PublicIP
Resources:
Networking:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://mcd-public-resources.s3.amazonaws.com/cloudformation/basic_vpc.yaml
Agent:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: https://mcd-public-resources.s3.amazonaws.com/cloudformation/aws_apollo_agent.yaml
Parameters:
CloudAccountId: !Ref CloudAccountId
ConcurrentExecutions: !Ref ConcurrentExecutions
ExistingVpcId: !GetAtt Networking.Outputs.VpcId
ExistingSubnetIds: !Join [ ',', [ !GetAtt Networking.Outputs.PrivateSubnetAz1, !GetAtt Networking.Outputs.PrivateSubnetAz2 ] ]
ImageUri: !Ref ImageUri
MemorySize: !Ref MemorySize
7 changes: 3 additions & 4 deletions templates/cloudformation/aws_apollo_agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ Metadata:
Parameters:
CloudAccountId:
Description: >
The service that invokes the agent is being migrated to the AWS Account with ID: 590183797493.
For accounts created after April 24th, 2024 select 590183797493, for previously created
accounts select the Monte Carlo account your collection service is hosted in.
This can be found in the 'settings/integrations/collectors' tab on the UI or via the 'montecarlo collectors list' command on the CLI.
For deployments on the V2 Platform, use 590183797493. Accounts created after April 24th, 2024,
will automatically be on the V2 platform or newer. If you are using an older version of the platform,
please contact your Monte Carlo representative for the ID.
Type: String
Default: '590183797493'
AllowedValues: [ '190812797848', '799135046351', '682816785079', '637423407294', '590183797493' ]
Expand Down
7 changes: 3 additions & 4 deletions templates/cloudformation/aws_data_store.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ Metadata:
Parameters:
MonteCarloCloudAccountId:
Description: >
The service that uses the bucket is being migrated to the AWS Account with ID: 590183797493.
For accounts created after April 24th, 2024 select 590183797493, for previously created
accounts select the Monte Carlo account your collection service is hosted in.
This can be found in the 'settings/integrations/collectors' tab on the UI or via the 'montecarlo collectors list' command on the CLI.
For deployments on the V2 Platform, use 590183797493. Accounts created after April 24th, 2024,
will automatically be on the V2 platform or newer. If you are using an older version of the platform,
please contact your Monte Carlo representative for the ID.
Type: String
Default: 590183797493
AllowedValues: [ 190812797848, 799135046351, 682816785079, 637423407294, 590183797493 ]
Expand Down

0 comments on commit 33fbc19

Please sign in to comment.