Amazon Web Services – CloudFormation: Creating security groups using SourceSecurityGroupName (within the same stack) depends on the build

I'm trying to automate the creation of a security group that uses the Source Security Group Name another security group created in the same batch.

That's how I set it up:

[...]    
    
    
    
Resources:
Bastion Security Group:
Type: AWS :: EC2 :: SecurityGroup
Properties:
GroupDescription: "Enables SSH Access from OfficeCidr"
SecurityGroupIngress:
- CidrIp :! Ref OfficeCidr
IpProtocol: & # 39; tcp & # 39;
FromPort: & # 39; 22 & # 39;
ToPort: & # 39; 22 & # 39;
VpcId :! ImportValue PrivateVpc
Inter Alba Transportation Security Group:
Type: AWS :: EC2 :: SecurityGroup
Depends on: [ BastionSecurityGroup ]
    Properties:
GroupDescription: "Enables SSH access from the bastion host"
SecurityGroupIngress:
- SourceSecurityGroupName :! GetAtt BastionSecurityGroup.GroupId
IpProtocol: & # 39; tcp & # 39;
FromPort: & # 39; 22 & # 39;
ToPort: & # 39; 22 & # 39;
VpcId :! ImportValue PrivateVpc
[...]

That's what happens:

Enter the image description here

It basically depends on trying the Inter Alba Transportation Security Group,