Until 05/23 I had no problems. I am using Jenkins and Packer to build an AMI. When I try to deploy an ami, I get an error: amazon-ebs: Exactly one VPC should match the filter, but 0 VPC’s was found matching filters.
I am using Packer version 1.8.3. Samething used to work everywhere about a week ago, but now it’s only working locally, but it’s not working from Jenkins pipeline. Nothing has changed (infra, networking,etc). My packer template (packer.json) looks like below:
“variables”: {
"aws_access_key_id": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_access_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"aws_session_token": "{{env `AWS_SESSION_TOKEN`}}",
“iam_instance_profile”: “{{ env IAM_INSTANCE_PROFILE
}}”
},
"builders": [
{
"type": "amazon-ebs",
"region": "us-east-2",
"ami_name": "ec2_packer-test1",
"instance_type": "t2.micro",
"source_ami": "ami-07a07fa6ccfasfsdf8",
"ssh_username": "ubuntu",
"ssh_interface": "session_manager",
"communicator": "ssh",
"iam_instance_profile": "test-ssm-packer-role",
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 32,
"volume_type": "gp2"
}
],
"vpc_filter": {
"filters": {
"tag:Name": "jenkins-ec2-testing-dev",
"isDefault": "false"
}
},
"subnet_filter": {
"filters": {
"tag:Name": "Jenkins-EC2-Agent-2a"
},
"random": true
}
}
],
"provisioners":[
{
"type": "shell",
"script": "packer.sh"
}
],
"sensitive-variables": ["aws_access_key_id","aws_secret_access_key","aws_session_token"]
}