Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module doesn't work with subnet_ids #14

Open
markl11 opened this issue Dec 16, 2021 · 1 comment
Open

Module doesn't work with subnet_ids #14

markl11 opened this issue Dec 16, 2021 · 1 comment

Comments

@markl11
Copy link

markl11 commented Dec 16, 2021

When I deploy version 0.3.0 with subnet_ids (which i need in order to ensure that endpoints are actually deployed into private subnets), I get an error:

module "ssm-session-manager" {
source = "bridgecrewio/session-manager/aws"
version = "0.3.0"
bucket_name = "my-session-logs"
access_log_bucket_name = "my-session-access-logs"
vpc_id = "vpc-XXXXXXXXXXXXXX"
subnet_ids = ["subnet-XXXXXXXXXXXXXX"]
tags = {
Function = "ssm"
}
enable_log_to_s3 = true
enable_log_to_cloudwatch = true
vpc_endpoints_enabled = true
}

│ Error: query returned no results. Please change your search criteria and try again

│ with module.ssm-session-manager.data.aws_route_table.selected[0],
│ on .terraform/modules/ssm-session-manager/vpce.tf line 11, in data "aws_route_table" "selected":
│ 11: data "aws_route_table" "selected" {

Would appreciate your help in resolving this.

Thanks,

@markl11
Copy link
Author

markl11 commented Dec 28, 2021

Just to add - this Terraform module creates the VPC endpoints but does not actually select Subnet IDs to put the VPC endpoint interfaces into.

So, it doesn't work at all when you want to use SSM Session Manager with EC2 instances in private subnets if those private subnets which is an extremely common deployment type for EC2 instances (ref: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-systems-manager-vpc-endpoints/).

I thought that the 'subnet_ids' parameter would help but unfortunately (as you can see above) using this just causes errors.

UPDATE I have found that the module doesn't work with 'subnet_ids' optional parameter if the subnets are using the default 'main' route table. But it will work IF you create a new route table for the subnets.

Perhaps you can update the module such that it works even if the 'main' route table is used with the subnets specified in the 'subnet_ids' parameter? thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant