You need to install something like AWS-CLI where you're running terraform.
You need to get the dependencies set up so that your CodeDeploy step would be one of the last things to be executed. If that is not the case you can play with "depends_on".
You can refer to the documentation here.
And once your code is posted, you would just need to add a
resource "something" "some_name" {
# Whatever config you've setup for the resource
provisioner "local-exec" {
command = "aws deploy create-deployment"
}
}
The AWS deploy created-deployment command is not yet complete, so you'll have to play with that in your environment till you have got the values needed to trigger the rollout but hopefully this is enough to get you started.
Do you want to master AWS? Then do check out the AWS Developer Associate Certification by Intellipaat.