Here what you need to do for networking infrastructure setup:
-
Install and setup AWS command line interface. (Refer:- https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html).
-
Configure your aws profile using the following command:
$ aws configure --profile produser
AWS Access Key ID [None]: <AccessID>
AWS Secret Access Key [None]: <AccessKey>
Default region name [None]: <region>
Default output format [None]:
-
Create CloudFormation template networking.json or networking.yaml that can be used to setup required networking resources.
-
Create Cloud formation Stack using the following command:
$ aws cloudformation create-stack \
--stack-name csye6225demo \
--parameters ParameterKey=InstanceTypeParameter,ParameterValue=value \
--template-body file://networking.json
- To Delete Cloud formation Stack use the following command.
$ aws cloudformation delete-stack --stack-name csye6225demo
Template Name,
AWS Region,
VPC Name,
VPC CIDR,
Subnet1 CIDER,
subnet2 CIDER,
subnet3 CIDER,
name of the JSON file
- Create a VPC(vpc)
- Three subnets created in the VPC
- Internet gateway, along with Internet gatewayVPC attachment
- Public Route table along with all the subnets attached to this table
- Public Route in the public Router table with destination CIDR block 0.0.0.0/0 and internet gateway created as target.
The following example shows how to import a certificate using the AWS Command Line Interface (AWS CLI). The example assumes the following:
- The PEM-encoded certificate is stored in a file named Certificate.pem. Use the following command to export your .crt or.cert file into .pem file
openssl x509 -in <youCrtFile>.crt -out <youCertName>.pem
- The PEM-encoded certificate chain is stored in a file named CertificateChain.pem. Use the following command to export your .ca-bundle file into .pem file
openssl x509 -in <yourCaBundleFile>.ca-bundle -out <yourCertChainName>.pem
-
The PEM-encoded, unencrypted private key is stored in a file named PrivateKey.pem.
-
THe following command imports the certificate to Amazon Certificate Manager.
$ aws acm import-certificate --certificate file://<youCertName>.pem --certificate-chain file://<yourCertChainName>.pem --private-key file:/<yourPrivateKey>.pem