I have just started to use AWS codebuild to test my infra with Terraform.
The codebuild container runs in a VPC, and I am wondering can I use terraform to determine the network interface id of the current codebuild container? How might I do that?
Alternatively could I acquire that information in the shell before running terraform and setting an env var?
Once I have this, I’d be able to attach security groups to that interface, which should be easy from that point.
I want to attach an extra security group, in this scenario right now, for vault and consul permissions - but there will probably be other reasons later.
If ECS metadata is available within the CodeBuild Container, then this should provide the task which has the security group definition.
I still have the feeling that the SGs should be attached ahead for the build in scope.