data"external""script"{program=["bash","./get_ip.sh"]// get_ip.sh is your script name}resource"aws_security_group""ubuntu"{name="ubuntu-security-group"description="Allow SSH only for 1.1.1.1"ingress{description="SSH"from_port=22to_port=22protocol="tcp"cidr_blocks=["${data.external.script.result}/32"]}}
i see. i have not tested it, but theoretically you can do something like that:
WOW - That's nice, I'm going try it! Thank you!!!