Search code examples
gitamazon-web-servicesterraformoctopus-deploy

Octopus Deploy with Terraform module from Git


I'm not exactly sure where my issue is here, but I believe it is on the octopus side. I am trying to deploy my octopus worker. There are essentially 4 steps to my deploy script.

  1. Update kube-config
    • aws eks update-kubeconfig
  2. Run helm upgrade
    • helm upgrade --install
  3. Create IAM Policy via terraform
    • cd terraform
    • terraform init
      • *With s3 backend parameters set
    • terraform plan -var-file=default.tfvars -out=tfplan
    • terraform apply tfplan
  4. Create IAM serviceaccount attach IAM policy to octopus worker role
    • eksctl create iamserviceaccount --attatch-policy-arn={iam-policy-arn}

I've left out some steps/flags, but this is the gist of it. I have a public github repo that houses all of my terraform modules. Inside this repo, I have a terraform directory where I reference that public repo:

module "octopus-worker-policy" {
  source = "git::ssh://git@github.com/{company}/terraform//{module_name}?ref={commit-hash}
  ... other variable info
}

When the deploy script gets to the terraform init step, it stalls once it starts trying to download this module. All of this WOMM, but for some reason once it is sent to the octopus worker it hangs. I have confirmed that the git repo in question is public, so there should be no permission/access issues.

Any ideas on why octopus may be struggling to download the repo? Maybe some networking / security rules with the node-group my workers are on? Let me know if there are some more details I can provide that may be helpful.


Solution

  • Ended up finding my answer. The octopus worker must have got some sort of interactive prompt because I was trying to source the git repo through ssh. Changed it to HTTPS and worked fine.