Skip to main content

CloudFormation - Nexus Repository

The following describes the process for deploying Nexus Repository Manager on Amazon Web Services using CloudFormation templates.

Requirements

  • An Amazon Web Services account

  • You have subscribed to the CentOS 7 image in the AWS Marketplace

  • An AWS key pair for SSH access to the EC2 instances. This is required to access the Repository Manager password. For instructions on creating your key pair please refer to the AWS Key Pair documentation. Please note that key pairs are per region.

Optional

  • A Nexus Repository Manager license file

  • An S3 Bucket to upload the Nexus Repository Manager license to

Subscribe to the CentOS 7 Image

If you have not already subscribed to the CentOS 7 image, do the following:

Navigate your browser to https://aws.amazon.com/marketplace/pp/B00O7WM7QW and sign in to your AWS account

Click the Continue to Subscribe button

126657420.png

To create the subscription, review the pricing information and accept the terms.

126657419.png

Your subscription request is processing...

126657418.png

Single Instance

This section outlines the steps to provision a single instance of Nexus Repository Manager.

Select a region for deployment

The minimal template provides the ability to set the license parameters, as well as a key pair to access the EC2 instances. The detailed template allows you to additionally customize items like the network details and EC2 instance type, as well as the Nexus Repository Manager version and Java version.

Region

Detailed Template

Minimal Template

US East (N. Virginia)

Launch

Launch

US East (Ohio)

Launch

Launch

US West (Oregon)

Launch

Launch

EU (Ireland)

Launch

Launch

EU (Frankfurt)

Launch

Launch

Asia Pacific (Sydney)

Launch

Launch

Canada (Montreal)

Launch

Launch

Select template

On the Select Template page, accept the defaults and click the Next button.

126657435.png

Specify Details

On the Specify Details page, fill in the name of your stack (Stack name), the name of the Key Pair in the selected deployment region (Key pair). Optionally provide the name of the S3 Bucket that contains your Nexus Repository Manager license file (License S3 bucket) and the path to your Nexus Repository Manager license file in your S3 Bucket (License S3 path). Then, click the Next button.

  • Key pairs are maintained over on the EC2 dashboard under "Key Pairs" in the left menu

  • If you haven't already loaded a Nexus Repository Manager Pro license up to S3 you can either create a new bucket in S3 or use an existing one and upload your license to either of those places

126657434.png

Options

If desired, fill out optional values on the Options page.

126657433.png

Review

On the Review page, make certain to check I acknowledge that AWS CloudFormation might create IAM resources with custom names and accept the other defaults. Then, click the Create button.

126657432.png

Stack Creation

Upon clicking the Create button on the Review page, you will be taken to the Stack page.

126657429.png

Stack Complete

After several minutes, stack creation will complete.

126657430.png

Website URL

To find the resulting Nexus Repository Manager website URL, select the stack name (usually at the bottom) and open the Outputs tab. Then, click the website URL link.

126657426.png

Login to Nexus Repository Manager

The website URL link will take you to the Nexus Repository Manager welcome page. Click the Sign In button at the top-right to login. The default username is admin and the password can be found in the admin.password file in the $data-dir directory.

NOTE: The allocation of AWS resources takes a while and there will be a delay in Nexus Repository Manager spinning up. The CloudWatch log group generated for the stack will provide feedback as to the progress, generally, if there are no logs AWS is still doing its allocation.

126657416.png

General Administration

SSH access to the Nexus Repository Instance

To SSH into the AWS Repository Instance, you need to have specified your AWS Key Pair during creation. The host name to connect to is available in the 'Outputs' section of the stack, you just need to remove the scheme (http) and port (8081). The username to use is "centos".

ssh -i <path to your key pair pem file> centos@ec2-54-68-224-196.us-west-2.compute.amazonaws.com

Managing the Repository Server service

The Nexus Repository server is controlled by the service name "nexus-repository-manager.service". Once you SSH in to the instance as "centos", you can manage the service with:

To stop the service: sudo systemctl stop nexus-repository-manager.service

To start the service: sudo systemctl start nexus-repository-manager.service

Create an S3 blob store and repository

In the admin screen select 'Repository' and 'Blob Stores'. Click 'Create blob store' and for the 'Type' choose 'S3'. Enter a name for the blob store and the S3 bucket. The rest of the information is optional. If you do not override the authentication information then the authentication details are taken from the EC2 instance. The CloudFormation template is setup with permissions to allow NXRM to create S3 buckets.

126657415.png