May be you might wanna try Terraform to automate your configuration. As for me, it's easier than do it by AWS CLI.