Yes, you can use AWS CloudFormation, Terraform, or other Infrastructure as Code (IaC) tools to automate the deployment of a Bastion Host.
Example using CloudFormation:
Resources:
BastionHost:
Type: AWS::EC2::Instance
Properties:
InstanceType: t2.micro
ImageId: ami-0abcdef1234567890
NetworkInterfaces:
- AssociatePublicIpAddress: 'true'
DeviceIndex: '0'
SubnetId: subnet-12345678
GroupSet:
- sg-12345678
KeyName: MyKeyPair