AWS for Nexus Repository Manager Quick Start

Repository Manager | Reading time: 12 minutes

Quick starts are automated reference deployments that use AWS CloudFormation templates to deploy key technologies on AWS, following AWS best practices.

This quick start reference deployment guide provides step-by-step instructions for deploying Nexus Repository Manager to the AWS Cloud. It is written for users looking to test the value of implementing a repository manager into their software development lifecycle. With this deployment, you can build an environment to use as a case for learning, as a proof of concept, or as a guideline for customization. This quick start is compatible with either the OSS or Pro version of Nexus Repository Manager.

AWS for Nexus Repository Quick Start Video

 

Nexus Repository Manager on AWS

Nexus Repository Manager is a dedicated server application used to manage all the repositories (such as Maven Central, npm, etc.) your teams use throughout the course of development. At its core, a repository manager does the following:

  • Proxies remote repositories and caches contents.
  • Hosts internal repositories.
  • Groups multiple repositories into one repository, providing a single URL for configuration.

Most of today’s software is assembled using open source, proprietary, and third party code. Because of this, many organizations rely on repository management to efficiently source, store, share, and deploy software parts. Rather than direct download from public repositories, repeated downloads, or manual distribution, using a repository manager provides a central access and management point for any component usage in your software development lifecycle.

This quick start provides a reference architecture for Nexus Repository Manager that you can deploy and use on AWS. It is best used as a proof-of-concept to test the implementation of Nexus Repository Manager in your organization.

You can launch Nexus Repository Manager OSS or Pro versions with this AWS CloudFormation template. If you have a license for Nexus Repository Manager Pro, you can BYOL (bring your own license) and specify your License S3 Bucket and Path in the stack. If you don’t specify a license, the template defaults to the OSS version.

Additional information about Nexus Repository Manager, and Sonatype’s entire suite of products, can be found on the Sonatype website.

Costs and Licenses

You are responsible for the cost of the AWS services used while running this quick start reference deployment. There is no additional cost for using the quick start.

The AWS CloudFormation template includes configuration parameters that you can customize. Some of these settings, such as instance type, will affect the cost of deployment. For cost estimates, see the pricing pages for each AWS service you will be using. Prices are subject to change.

AWS CloudFormation is available at no additional charge, and you pay only for the AWS resources needed to run your applications.

Architecture

Deploying this quick start to a new Virtual Private Cloud (VPC) with the default parameters builds the following Nexus Repository Manager environment in the AWS Cloud:

The quick start sets up the following:

  • A single virtual private cloud with a single subnet, to provide you with your own virtual network on AWS.
  • An internet gateway to allow access to the internet.
  • An EC2 instance for running Nexus Repository Manager.
  • An Elastic Block Store (EBS) for storing Nexus Repository Manager and its data. The EBS is the “hard disk,” and it is separate from the EC2 instance which is actually running Nexus Repository Manager. This setup prevents data loss in the event that the instance dies for any reason.

AWS CloudFormation Templates

AWS CloudFormation templates are JSON or YAML text files that describe the AWS framework needed to run an application or service. When using AWS CloudFormation, all related resources are managed as a single instance called a stack. This means that when you create, update, and delete a group of resources, you are doing so by creating, updating, and deleting the stack. All the resources in a stack are defined by its AWS CloudFormation template.

For more information about AWS CloudFormation and stacks, see the AWS CloudFormation documentation.

Templates Used in This Quick Start

This quick start has two available templates — a minimal template and a detailed template:

  • The minimal template has fewer parameters to define. Only the stack name and launch configuration parameters are available. This option uses nested AWS CloudFormation templates to deploy the architecture for a test instance of Nexus Repository Manager.
  • The detailed template has the same parameters as the minimal template, but also lets you define the Network Configuration, Instance Configuration, Nexus Repository Manager version, Java version, and CloudWatch log group name.

Prerequisites

Before you deploy this quick start, we recommend that you become familiar with the following AWS services. If you are new to AWS, see Getting Started with AWS.

  • Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud.
  • Amazon Elastic Block Store (Amazon EBS) provides persistent block storage volumes for use with Amazon EC2 instances in the AWS Cloud.
  • Amazon Virtual Private Cloud (Amazon VPC) lets you provision a logically isolated section of the AWS Cloud where you can launch AWS resources in a virtual network that you define.
  • Amazon S3 is object storage built to store and retrieve any amount of data from anywhere.

Deployment Steps

Step 1. Prepare Your AWS Account

  1. If you don’t already have an AWS account, create one at https://aws.amazon.com by following the on-screen instructions.
  2. Use the region selector in the navigation bar to choose the AWS Region where you want to deploy Nexus Repository Manager on AWS.

    Tip: This quick start lets you choose from the following regions: US East (N. Virginia), US East (Ohio), US West (Oregon), US West (N. California), CA Central 1 (Montreal), EU (Ireland), EU (Frankfurt), and Asia Pacific (Sydney).

  3. Create a key pair in your preferred region (optional):

    • In the Amazon EC2 console, select the AWS region where you plan to deploy. Under Network & Security, select Key Pairs and then select the option to Create a Key Pair. For more information, see the Amazon EC2 documentation.
    • Take note of the key pair name as you will need that in a future step.

    Note: Because this quick start is designed for testing or proof of concept, we recommend that you create a new key pair instead of one that’s used in a production instance.

  4. If using a license for the Pro version, add the license file to your S3 bucket: Place your license file in an Amazon Simple Storage Service (Amazon S3) bucket and point to it in the Licenses parameter when you launch the quick start. Alternatively, you can upload your license file after deployment via the Nexus Repository Manager application. If you don’t have a license, the templates default to the OSS version.

    Important: Your S3 bucket should remain private and secured.

  5. If necessary, request a service limit increase for the Amazon EC2 CloudFormation Stack instance type. You might need to do this if you already have an existing deployment that uses this instance type and you think you might exceed the default limit with this deployment.

Step 2. Launch the Quick Start

Note: You are responsible for the cost of the AWS services used while running this quick start reference deployment. There is no additional cost for using this quick start. For full details, see the pricing pages for each AWS service you will be using in this quick start. Prices are subject to change.

  1. Select an option below to launch the minimal or detailed AWS CloudFormation template into your AWS account:

    See Deployment Option Parameters for more parameter details on these options.

  2. Check the region that’s displayed in the upper-right corner of the navigation bar and change it if necessary.

    This is where the network infrastructure for Nexus Repository Manager builds. The template launches in the US East (N. Virginia) Region by default.

    Tip: This quick start lets you choose from the following regions: US East (N. Virginia), US East (Ohio), US West (Oregon), US West (N. California), CA Central 1 (Montreal), EU (Ireland), EU (Frankfurt), and Asia Pacific (Sydney).

  3. On the Select Template page, keep the default setting for the template URL and then choose Next.

  4. On the Specify Details page:

    • Enter a stack name.
    • Review the parameters for the template. Provide values for the parameters that require input. For all other parameters, review the default settings and customize them as necessary.
    • When you finish reviewing and customizing the parameters, choose Next.
  5. On the Options page, you can specify tags (key-value pairs) for resources in your stack and set advanced options. When you’re done, choose Next.

  6. On the Review page, review and confirm the template settings. Under Capabilities, select the check box to acknowledge that the template will create IAM resources.

  7. Choose Create to deploy the stack.

  8. Monitor the status of the stack. When the status reads “CREATE_COMPLETE,” it means the stack has built and Nexus Repository Manager is being deployed. Please note that the deployment process takes another few minutes.

  9. Open the Outputs section and select the Website URL to view the newly created Nexus Repository Manager instance.

    Note: Each stack takes about 10 minutes to create. When the Cloudformation output reads CREATE_COMPLETE, there may still be a short delay in Nexus Repository Manager spinning up. The CloudWatch log group generated for the stack provides feedback on the progress. If there are no logs, AWS is still doing its allocation.

Deployment Option Parameters

In the following tables, parameters are listed by category and described separately for the two deployment options:

Option 1: Parameters for Deploying Nexus Repository Manager - Minimal Template

View template on AWS

VPC Network Configuration:
Parameter label (name) Default Description
Availability Zones(AvailabilityZones) Requires input The list of Availability Zones to use for the subnets in the VPC. The quick start uses two Availability Zones from your list and preserves the logical order you specify.
VPC CIDR(VPCCIDR) 10.0.0.0/16 The CIDR block for the VPC.
Private Subnet 1 CIDR(PrivateSubnet1CIDR) 10.0.0.0/19 The CIDR block for the private subnet located in Availability Zone 1.
Private Subnet 2 CIDR(PrivateSubnet2CIDR) 10.0.32.0/19 The CIDR block for the private subnet located in Availability Zone 2.
Public Subnet 1 CIDR(PublicSubnet1CIDR) 10.0.128.0/20 The CIDR block for the public (DMZ) subnet located in Availability Zone 1.
Public Subnet 2 CIDR(PublicSubnet2CIDR) 10.0.144.0/20 The CIDR block for the public (DMZ) subnet located in Availability Zone 2.
Permitted IP range(AccessCIDR) Requires input The CIDR IP range that is permitted to access Nexus Repository Manager. We recommend that you set this value to a trusted IP range. For example you might want to grant only your corporate network access to the software.
Amazon EC2 Configuration:
Parameter label (name) Default Description
Key Name(KeyPairName) Requires input A public/private key pair which allows you to connect securely to your instance after it launches. When you created an AWS account this is the key pair you created in your preferred region.
AWS Quick Start Configuration:
Parameter label (name) Default Description
Quick start S3 Bucket Name(QSS3BucketName) quickstart-reference The S3 bucket you have created for your copy of quick start assets, if you decide to customize or extend the quick start for your own use. The bucket name can include numbers, lowercase letters, uppercase letters, and hyphens, but should not start or end with a hyphen.
Quick start S3 Key Prefix(QSS3KeyPrefix) atlassian/bitbucket/latest/ The S3 key name prefix used to simulate a folder for your copy of quick start assets, if you decide to customize or extend the quick start for your own use. This prefix can include numbers, lowercase letters, uppercase letters, hyphens, and forward slashes.

Option 2: Parameters for Deploying Nexus Repository Manager - Detailed Template

View Template on AWS

Network Configuration:
Parameter label (name) Default Description
VPC ID(VPCID) Requires input The ID of your existing VPC (e.g. vpc-0343606e).
Private Subnet 1 ID(PrivateSubnet1ID) Requires input The ID of the private subnet in Availability Zone 1 in your existing VPC (e.g. subnet-a0246dcd).
Private Subnet 2 ID(PrivateSubnet2ID) Requires input The ID of the private subnet in Availability Zone 2 in your existing VPC (e.g. subnet-b58c3d67).
Bastion Security Group ID (BastionSecurityGroupID) Requires input The ID of the bastion security group in your existing VPC (e.g. sg-7f16e910).
Amazon EC2 Configuration:
Parameter label (name) Default Description
Key Pair Name(KeyPairName) Requires input A public/private key pair which allows you to connect securely to your instance after it launches. When you created an AWS account this is the key pair you created in your preferred region.

Step 4. Test the Deployment

The Website URL link takes you to the Nexus Repository Manager welcome page.

Click Sign In at the top-right to login (default is admin/admin123).

Step 5: Cleanup

When you are done testing, go to the AWS CloudFormation console and delete the AWS CloudFormation stack associated with this quick start. Deleting a stack removes all the resources created by the template for that stack.

If you set the EBS (root block device) parameter to “true,” then it’s automatically deleted. If you set the option as “false,” you need to manually delete the instance’s root block device.

Important: These options use nested AWS CloudFormation templates. Deleting the main stack removes the nested stacks and all associated resources.

Troubleshooting

  • I encountered a CREATE_FAILED error when I launched the quick start.

    • If AWS CloudFormation fails to create the stack, we recommend that you relaunch the template with Rollback on failure set to No. (This setting is under Advanced in the AWS CloudFormation console, Options page.) With this setting, the stack’s state will be retained and the instance will be left running, so you can troubleshoot the issue. (Look at the log files in /var/log/cloud-init.log for more information.)

    Important: When you set Rollback on failure to No, you will continue to incur AWS charges for this stack. Please make sure to delete the stack when you finish troubleshooting.

    For additional information, see Troubleshooting AWS CloudFormation on the AWS website.

  • I encountered a size limitation error when I deployed the AWS Cloudformation templates.

    • We recommend that you launch the quick start templates from the location we’ve provided or from another S3 bucket. If you deploy the templates from a local copy on your computer or from a non-S3 location, you might encounter template size limitations when you create the stack. For more information about AWS CloudFormation limits, see the AWS documentation.

Additional Resources

AWS Services

Nexus Repository Manager Documentation

Quick Start Reference Deployments

Send us Feedback

We’d like to hear your questions and comments. Post your feedback on the AWS Quick Start Discussion Forum or contact us directly with comments and questions at sonatype-nexus-community/deployment-reference-architecture.

References

This guide is based on the Deployment Guide Template available from the Amazon Web Services Quick Start Contributor’s Guide.