Creating an Application Load Balancer
To create and import a TLS certificate into AWS Certificate Manager
To deploy BMC AMI AI Services on AWS Cloud, you must create and import a TLS certificate into AWS Certificate Manager to establish secure, encrypted connections for your applications.
- If you already have a certificate authority (CA), you can reuse it for this deployment process. Otherwise, you or your internal IT security team must create a self-signed CA. Create the certificate for the domain hosting BMC AMI AI Services. Then store the certificate in a safe place to upload to the AWS Application Load Balancer, as described in .
Create or acquire (from a CA) a certificate to extract the certificate_chain.pem, privatekey.pem, and server_certificate.pem files by running the following commands in your terminal:
openssl pkcs12 -in <your certificate name.pfx> -clcerts -nokeys -out server_certificate.pem -legacyopenssl pkcs12 -in <your certificate name.pfx> -cacerts -nokeys -out certificate_chain.pem -legacyopenssl pkcs12 -in <your certificate name.pfx> -nocerts -out privatekey.pem -nodes -legacyOpen the AWS Certificate Manager (ACM) console athttps://console.aws.amazon.com/acm/home.
- Select Import a certificate and follow these steps:
For Certificate body, paste the PEM-encoded certificate as follows:
----BEGIN CERTIFICATE---
<text>
---END CERTIFICATE----For Certificate private key, paste the certificate's PEM-encoded, unencrypted private, as follows:
----BEGIN PRIVATE KEY---
<text>
---END PRIVATE KEY----- (Optional) For Certificate chain, paste the PEM-encoded certificate chain.
- Click Review and import.
- On the Review and import page, verify the metadata displayed on your certificate. The fields on this page are as follows:
- Domains—A list of fully qualified domain names (FQDN) authenticated by the certificate
- Expires in—The number of days until the certificate expires
- Public key info—The cryptographic algorithm generates the key pair
- Signature algorithm—The cryptographic algorithm used to create the certificate's signature
Can be used with—A list of ACMIntegrated servicesthat support the type of certificate you are importing
- If everything is correct, click Import.
To create a load balancer
Follow these steps to create a load balancer.
To configure a target group
Open the Amazon EC2 console athttps://console.aws.amazon.com/ec2/.
- In the navigation pane, click Target Groups.
- Click Create target group.
- In the Basic configuration section, set the following parameters:
- For Choose a target type, select Instances.
- For Target group name, enter a name such as AMIAI-Target.
- Modify the Protocol to HTTP and Port to 8000.
- Select IP address type as IPv4.
- For VPC, select the VPC from the menu.
- For Protocol version, select HTTP1.
- In the Health checks section, enter HTTP for the protocol.
- Enter the following health check path: /admin/
- Click Advanced health check settings.
- Click Override and enter port 8000.
- Click Next.
To register targets
- On the Register targets page, select the EC2 instance created in the Creating-an-EC2-instance step.
- Enter port 8000.
- Click Include as pending below.
- Click Create target group.
To configure a load balancer and a listener
Open the Amazon EC2 console athttps://console.aws.amazon.com/ec2/.
- In the navigation pane, click Load Balancers.
- Click Create Load Balancer.
- Under Application Load Balancer, click Create.
- In the Basic configuration area, follow these steps:
- In the Load balancer name field, enter the name of your load balancer (for example, AMIAI-ALB).
- For Scheme, select Internet-facing.
- For IP address type, select IPv4.
- In the Network mapping area, follow these steps:
- For VPC, select the VPC that you used for your EC2 instances.
- For Mappings, select any two Availability Zones.
- Accept the subnets assigned by AWS.
- In the Security groups area, select the security group created in EC2 instances.
- In the Listeners and routing area, follow these steps:
- From the Protocol menu, select HTTPS.
- In the Port field, enter 443.
- For Default action, select the target group that you created earlier. This creates an association between the target group and the load balancer.
- In the Secure Listener Settings area, select the latest predefined security policy.
- In the Default SSL/TLS certificate, select From ACM and then select the certificate that you imported in step 2 of the previous section.
- In the AWS Web Application Firewall (WAF) area, select the Include WAF security protections behind the load balancer check box.
- Accept the other defaults and click Create load balancer.
Updating Amazon Route 53
- Assign the domain name to the AWS Load balancer
Sign in to the AWS Management Console and open the Route 53 console athttps://console.aws.amazon.com/route53/.
- Click Create hosted zone.
- In the Create Hosted Zone area, enter the domain name (for example, bmc.com).
- For Type, accept the default value of Public hosted zone.
- Click Create hosted zone.
- In the Records area, click Create record.
- In the Record name field, enter subdomain name (for example, www.amiaiaws).
- In the Record type field, select A - Routes traffic to an IPv4 address and some AWS resources.
- Switch the Alias toggle key to On.
- In the Route traffic section, follow these steps:
- From the first menu, select Alias to Application and Classic Load Balancer.
- From the first menu, select the region where the application load balancer was created.
- Select the load balancer that you created. (The load balancer has a dual-stack prefix.)
- Select Simple Routing as the Routing policy.
- Switch the Evaluate target health toggle key to Yes.
- Click Create records button to create the A record.
- After a few minutes, verify that the domain name resolves to the public IP of the application load balancer. Then run the following command prompt to verify that the domain resolves to the public IP of the application load balancer, replacing domain after nslookup with the domain value that you entered in step c.
Where to go from here