Description: >- This template deploys a VPC, with a pair of public and private subnets spread across two Availability Zones. It deploys an Internet Gateway, with a default route on the public subnets. It deploys a pair of NAT Gateways (one in each AZ), and default routes for them in the private subnets. Parameters: EC2SSHKeyPairName: Description: >- Name of an existing EC2 KeyPair to enable SSH access to the instances. Required Input Type: 'AWS::EC2::KeyPair::KeyName' AllowedPattern : ".+" ConstraintDescription: Must be the name of an existing EC2 KeyPair in same region. Env: Description: 'Environment tag, e.g. prod, nonprod.' Default: test Type: String AllowedPattern: '[a-z0-9]+' MaxLength: 15 DbInstanceType: Description: Neptune DB instance type Type: String Default: db.r4.xlarge AllowedValues: - db.r4.large - db.r4.xlarge - db.r4.2xlarge - db.r4.4xlarge - db.r4.8xlarge ConstraintDescription: Must be a valid Neptune instance type. DBReplicaIdentifierSuffix: Description: >- OPTIONAL: The ID for the Neptune Replica to use. Empty means no read replica. Type: String Default: '' DBClusterPort: Type: String Default: '8182' Description: Enter the port of your Neptune cluster DBSnapshot: Type: String Default: 'arn:aws:rds:us-west-2:305705277353:cluster-snapshot:shopbystyle-blog-public' EC2ClientInstanceType: Description: EC2 client instance Type: String Default: r4.2xlarge AllowedValues: - t2.micro - t2.small - t2.medium - m4.large - m4.xlarge - m4.2xlarge - m4.4xlarge - m4.10xlarge - r4.large - r4.xlarge - r4.2xlarge - r4.4xlarge - r4.8xlarge ConstraintDescription: Must be a valid EC2 instance type. NeptuneQueryTimeout: Type: Number Default: 20000 Description: Neptune Query Time out (in milliseconds) NeptuneEnableAuditLog: Type: Number Default: 0 AllowedValues: - 0 - 1 Description: Enable Audit Log. 0 means disable and 1 means enable. IamAuthEnabled: Type: String Default: 'false' AllowedValues: - 'true' - 'false' Description: Enable IAM Auth for Neptune. SetupGremlinConsole: Type: String Default: 'true' AllowedValues: - 'true' - 'false' Description: Setup Gremlin console. SetupRDF4JConsole: Type: String Default: 'true' AllowedValues: - 'true' - 'false' Description: Setup RDF4J console. AttachBulkloadIAMRoleToNeptuneCluster: Type: String Default: 'true' AllowedValues: - 'true' - 'false' Description: Attach Bulkload IAM role to cluster Conditions: CreateDBReplicaInstance: !Not - !Equals - !Ref DBReplicaIdentifierSuffix - '' Resources: WebAssetStack: Type: 'AWS::CloudFormation::Stack' Properties: TemplateURL: !Join - '' - - >- https://s3-us-west-2.amazonaws.com/aws-ml-blog-usw2/artifacts/shop-by-style/cloudformation/deployweb.yaml TimeoutInMinutes: '120' NeptuneStack: Type: 'AWS::CloudFormation::Stack' Properties: TemplateURL: !Join - '' - - >- https://s3-us-west-2.amazonaws.com/aws-ml-blog-usw2/artifacts/shop-by-style/cloudformation/neptune.yaml TimeoutInMinutes: '120' Parameters: Env: !Ref Env DBReplicaIdentifierSuffix: !Ref DBReplicaIdentifierSuffix DBClusterPort: !Ref DBClusterPort DbInstanceType: !Ref DbInstanceType NeptuneQueryTimeout: !Ref NeptuneQueryTimeout NeptuneEnableAuditLog: !Ref NeptuneEnableAuditLog IamAuthEnabled: !Ref IamAuthEnabled DBSnapshot: !Ref DBSnapshot NeptuneEC2Client: Type: 'AWS::CloudFormation::Stack' Properties: TemplateURL: !Join - '' - - >- https://s3.amazonaws.com/aws-neptune-customer-samples/v2/cloudformation-templates/neptune-ec2-client.json TimeoutInMinutes: '30' Parameters: Env: !Ref Env EC2SSHKeyPairName: !Ref EC2SSHKeyPairName EC2ClientInstanceType: !Ref EC2ClientInstanceType SetupGremlinConsole: !Ref SetupGremlinConsole SetupRDF4JConsole: !Ref SetupRDF4JConsole AttachBulkloadIAMRoleToNeptuneCluster: !Ref AttachBulkloadIAMRoleToNeptuneCluster VPC: !GetAtt - NeptuneStack - Outputs.VPC Subnet: !GetAtt - NeptuneStack - Outputs.PublicSubnet1 NeptuneDBCluster: !GetAtt - NeptuneStack - Outputs.DBClusterId NeptuneDBClusterEndpoint: !GetAtt - NeptuneStack - Outputs.DBClusterEndpoint NeptuneDBClusterPort: !GetAtt - NeptuneStack - Outputs.DBClusterPort NeptuneLoadFromS3IAMRoleArn: !GetAtt - NeptuneStack - Outputs.NeptuneLoadFromS3IAMRoleArn NeptuneSG: !GetAtt - NeptuneStack - Outputs.NeptuneSG NeptuneEC2InstanceProfile: !GetAtt - NeptuneStack - Outputs.NeptuneEC2InstanceProfile MicroservicesStack: Type: 'AWS::CloudFormation::Stack' Properties: TemplateURL: !Join - '' - - >- https://s3-us-west-2.amazonaws.com/aws-ml-blog-usw2/artifacts/shop-by-style/cloudformation/microservices.yaml TimeoutInMinutes: '30' Parameters: Subnet1: !GetAtt - NeptuneStack - Outputs.PublicSubnet1 Subnet2: !GetAtt - NeptuneStack - Outputs.PublicSubnet2 Subnet3: !GetAtt - NeptuneStack - Outputs.PublicSubnet3 NeptuneDBClusterEndpoint: !GetAtt - NeptuneStack - Outputs.DBClusterEndpoint NeptuneDBClusterPort: !GetAtt - NeptuneStack - Outputs.DBClusterPort NeptuneSG: !GetAtt - NeptuneStack - Outputs.NeptuneSG Outputs: ShoeRackPageURL: Description: url to sample shop-by-style webpage Value: !Join - '' - - !GetAtt [WebAssetStack, Outputs.SampleWebPageURL] - "?provider=" - !GetAtt [MicroservicesStack, Outputs.ServerlessRestApiInvokeURL] Export: Name: ShoeRackPageURL GraphVisURL: Description: url to sample graph visualization webpage Value: !Join - '' - - !GetAtt [WebAssetStack, Outputs.SampleGraphVisURL] - "?provider=" - !GetAtt [MicroservicesStack, Outputs.ServerlessRestApiInvokeURL] Export: Name: GraphVisURL DBClusterId: Description: Neptune Cluster Identifier Value: !GetAtt - NeptuneStack - Outputs.DBClusterId DBSubnetGroupId: Description: Neptune DBSubnetGroup Identifier Value: !GetAtt - NeptuneStack - Outputs.DBSubnetGroupId DBClusterResourceId: Description: Neptune Cluster Resource Identifier Value: !GetAtt - NeptuneStack - Outputs.DBClusterResourceId DBClusterEndpoint: Description: Master Endpoint for Neptune Cluster Value: !GetAtt - NeptuneStack - Outputs.DBClusterEndpoint DBInstanceEndpoint: Description: Master Instance Endpoint Value: !GetAtt - NeptuneStack - Outputs.DBInstanceEndpoint DBReplicaInstanceEndpoint: Description: ReadReplica Instance Endpoint Condition: CreateDBReplicaInstance Value: !GetAtt - NeptuneStack - Outputs.DBReplicaInstanceEndpoint SparqlEndpoint: Description: Sparql Endpoint for Neptune Value: !GetAtt - NeptuneStack - Outputs.SparqlEndpoint GremlinEndpoint: Description: Gremlin Endpoint for Neptune Value: !GetAtt - NeptuneStack - Outputs.GremlinEndpoint LoaderEndpoint: Description: Loader Endpoint for Neptune Value: !GetAtt - NeptuneStack - Outputs.LoaderEndpoint DBClusterReadEndpoint: Description: DB cluster Read Endpoint Value: !GetAtt - NeptuneStack - Outputs.DBClusterReadEndpoint DBClusterPort: Description: Port for the Neptune Cluster Value: !GetAtt - NeptuneStack - Outputs.DBClusterPort NeptuneLoadFromS3IAMRoleArn: Description: IAM Role for loading data in Neptune Value: !GetAtt - NeptuneStack - Outputs.NeptuneLoadFromS3IAMRoleArn NeptuneIamAuthUser: Description: IAM User for IAM Auth Value: !GetAtt - NeptuneStack - Outputs.NeptuneIamAuthUser EC2Client: Description: EC2 client Identifier Value: !GetAtt - NeptuneEC2Client - Outputs.EC2Client SSHAccess: Description: This is how you gain remote access to the EC2 client. Value: !GetAtt - NeptuneEC2Client - Outputs.SSHAccess VPC: Description: VPC Value: !GetAtt - NeptuneStack - Outputs.VPC Subnet1: Description: Subnet1 Value: !GetAtt - NeptuneStack - Outputs.PublicSubnet1 Subnet2: Description: Subnet2 Value: !GetAtt - NeptuneStack - Outputs.PublicSubnet2 Subnet3: Description: Subnet3 Value: !GetAtt - NeptuneStack - Outputs.PublicSubnet3