- Newest
- Most votes
- Most comments
Thanks for your answer. I assume that in your case the SDK wants to rebuild the association according to its policy "Replacement" because eip parameter is deprecated https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-eipassociation.html but accordingly cannot do it because this association is created for this IP address. So in my opinion you can try commenting on CfnEIPAssociation after launching cdk again to detach eip from instance after that uncomment and run cdk to attach eip.
Best regards, Andrii
Thanks it works (but break ssh if it happend connect to the machine via aws and restart it sudo systemctl start sshd )
Could you please provide information on how many network interfaces has your instances? If your instance has two network interfaces, you must provide the same IP and network interface id you use in the old cdk version.
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import { aws_ec2 as ec2 } from 'aws-cdk-lib'; const cfnEIPAssociation = new ec2.CfnEIPAssociation(this, 'MyCfnEIPAssociation', /* all optional props */ { allocationId: 'allocationId', eip: 'eip', instanceId: 'instanceId', networkInterfaceId: 'networkInterfaceId', privateIpAddress: 'privateIpAddress', });
Best regards, Andrii
Thanks for the feedback but I just have one network interface
Don't if it can be a clue but the instance is a Bastion
this.bastion = new BastionHostLinux(this, "euodia-managment-bastion", {
vpc: this.vpc,
instanceName: "euodia-managment-bastion",
securityGroup: this.sg,
subnetSelection: {
subnetType: SubnetType.PUBLIC
}
});
Hello. Could you please accept the answer if it helps you? Best regards, Andrii
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated a month ago