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

Missing parameters when using own vpc #50

Closed
Jaff opened this issue May 3, 2019 · 10 comments
Closed

Missing parameters when using own vpc #50

Jaff opened this issue May 3, 2019 · 10 comments

Comments

@Jaff
Copy link

Jaff commented May 3, 2019

I'm invoking the module atlantis using following variable settings:

  atlantis_repo_whitelist     = [our primary repository]
  allow_repo_config           = true
  atlantis_allowed_repo_names = []
  atlantis_github_user        = "userbot"
  atlantis_github_user_token  = "EXAMPLE"
  azs                         = "${data.terraform_remote_state.vpc.avail_zones}"
  ecs_service_assign_public_ip = true
  private_subnet_ids            = "${data.terraform_remote_state.vpc.private_subnets}"
  public_subnet_ids             = "${data.terraform_remote_state.vpc.public_subnets}"
  route53_zone_name             = "${data.terraform_remote_state.r53.fqdn}"
  vpc_id                        = "${data.terraform_remote_state.vpc.vpc_id}"

But then I get an error message:
Error: module.atlantis.module.vpc.aws_vpc.this: expected cidr_block to contain a valid CIDR, got: with err: invalid CIDR address:

@Jaff
Copy link
Author

Jaff commented May 6, 2019

I thought it might be due to unequal-length public & private subnets, but I explicitly set both to two and still get the same result. I am providing parameters for all variables, private_subnet_ids, private_subnets, public_subnet_ids, & public_subnets.

@tebriel
Copy link

tebriel commented May 10, 2019

I got this same issue, I submoduled this repo and changed create_vpc to be explicitly false, and that fixed my issue. I believe it's because the ternary in the aws-vpc module doesn't evaluate properly on the boolean value outputted from the check if the vpc id equals "" or not, but I'm not 100% sure.

@Jaff
Copy link
Author

Jaff commented May 10, 2019

Would you please explain how you "submoduled this repo" ?

@tebriel
Copy link

tebriel commented May 10, 2019

I forked it, did:

mkdir -p modules
git submodule add ${git_clone_url} modules/terraform-aws-atlantis
cd modules/terraform-aws-atlantis
git checkout my-fix-branch
cd ../../
git add modules/terraform-aws-atlantis

then updated my module as follows

module "atlantis" {
  # source  = "terraform-aws-modules/atlantis/aws"
  source  = "./modules/terraform-aws-atlantis"
  # Snip, the rest of the module

@Jaff
Copy link
Author

Jaff commented May 13, 2019

@tebriel Have you made a PR for your fix?

@tebriel
Copy link

tebriel commented May 13, 2019

@Jaff no, I can't find a way to make it work the same way a hardcoded false does.

@Jaff
Copy link
Author

Jaff commented May 14, 2019

I've gotten a bit farther with this, doing essentially the same as @tebriel but now I'm not able to launch the container. My logs display the command I've provided followed by 'not found' like:

/usr/local/bin/docker-entrypoint.sh: exec: line 46: atlantis server --log-level=debug \
--gh-user=XXXX --gh-token="YYYYY" --gh-webhook-secret="something" --repo-config-json='
{
    "repos": [
        {
            "id": "/.*/",
            "allowed_overrides": [
                "workflow"
            ],
            "allow_custom_workflows": true,
            "apply_requirements": [
                "approved",
                "mergeable"
            ]
        }
    ]
}
' --repo-whitelist=github.com/our/repository: not found

Where did I go wrong?

@tebriel
Copy link

tebriel commented May 14, 2019

why is your json multiline like that? that seems possibly bad, maybe minify it to a single line and see if those newlines are your problem

@Jaff
Copy link
Author

Jaff commented May 30, 2019

Gotten past this with different implementation

@github-actions
Copy link

github-actions bot commented Nov 9, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants