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

[Bug]: CodeCommit is not accessible to new customers #1142

Open
tphokas opened this issue Oct 9, 2024 · 2 comments
Open

[Bug]: CodeCommit is not accessible to new customers #1142

tphokas opened this issue Oct 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tphokas
Copy link

tphokas commented Oct 9, 2024

Installation method

Own AWS account

What happened?

Automation module fails to prepare environment for both flux and argo for accounts that don't have CodeCommit repo due to recent CodeCommit deprecation.

https://aws.amazon.com/blogs/devops/how-to-migrate-your-aws-codecommit-repository-to-another-git-provider/

~/environment $ prepare-environment automation/gitops/flux
Refreshing copy of workshop repository from GitHub...

Resetting the environment...
Tip: Read the rest of the lab introduction while you wait!
Waiting for application to become ready...
Cleaning up previous lab infrastructure...
Creating infrastructure for next lab...
╷
│ Error: creating CodeCommit Repository (eks-workshop-gitops): operation error CodeCommit: CreateRepository, https response error StatusCode: 400, RequestID: de2abb05-0b45-4adf-9782-081f5b9b94f8, OperationNotAllowedException: CreateRepository request is not allowed because there is no existing repository in this AWS account or AWS Organization
│ 
│   with module.lab.aws_codecommit_repository.gitops,
│   on lab/main.tf line 1, in resource "aws_codecommit_repository" "gitops":
│    1: resource "aws_codecommit_repository" "gitops" {
│ 
╵
╷
│ Error: creating CodeCommit Repository (eks-workshop-retail-store-sample): operation error CodeCommit: CreateRepository, https response error StatusCode: 400, RequestID: ffe3181d-9a9a-4300-8efa-bc4804035ad5, OperationNotAllowedException: CreateRepository request is not allowed because there is no existing repository in this AWS account or AWS Organization
│ 
│   with module.lab.aws_codecommit_repository.codecommit_retail_store_sample,
│   on lab/main.tf line 96, in resource "aws_codecommit_repository" "codecommit_retail_store_sample":
│   96: resource "aws_codecommit_repository" "codecommit_retail_store_sample" {
│ 
╵
An error occurred, please contact your workshop proctor or raise an issue at https://github.com/aws-samples/eks-workshop-v2/issues
The full log can be found here: /eks-workshop/logs/action-1728471547.log

What did you expect to happen?

N/A

How can we reproduce it?

Run prepare-environment automation/gitops/argocd on a new AWS account

Anything else we need to know?

No response

EKS version

N/A

@tphokas tphokas added the bug Something isn't working label Oct 9, 2024
@niallthomson
Copy link
Contributor

Hi @tphokas apologies for running in to this. We're currently weighing our options for migrating away from CodeCommit.

@MalcolmFeatonby
Copy link

MalcolmFeatonby commented Feb 20, 2025

Interim work around the CodeCommit not being available to new customers using a github account.

  1. Run “prepare-environment automation/gitops/argocd”

If it fails with the error:
“│ Error: creating CodeCommit Repository (eks-workshop-gitops): operation error CodeCommit: CreateRepository, https response error StatusCode: 400, RequestID: xxxxxxxxxx, OperationNotAllowedException: CreateRepository request is not allowed because there is no existing repository in this AWS account or AWS Organization”

Do the following:

  1. Set up the known hosts:
    curl --silent https://api.github.com/meta | jq --raw-output '"github.com "+.ssh_keys[]' >> ~/.ssh/known_hosts

  2. Create a GitHub account if you don’t have one

  3. In your GitHub account

  • Create a new repo called “eks-workshop-argocd”
  1. Point the EKS Workshop workspace at your new GtHub Repo:
  • go to your repo in GitHub
  • Click the Green CODE button
  • select SSH
  • Copy to clipboard - should look something like [email protected]:<Your REPO Name>/eks-workshop-argocd.git
  1. In the workshop terminal run this (value after = is what you copied above):
    export [email protected]:<Your REPO Name>/eks-workshop-argocd.git

  2. Now create a new SSH key to access the GitHub repo from your workshop terminal

  • run this: ssh-keygen -t rsa -C “[email protected]” -f ~/.ssh/argo-git-ops
  • Leave the passphrase blank (press enter)
  1. In GitHub add the key to your GitHub repo (the .pub file)
  • Github link to add SSH key
    • in GitHub select your profile (top right)
    • Choose settings
    • Choose SSH and GPG keys
    • Choose New SSH Key
    • Name it
    • Select Authentication Key
    • Past the output from cat ~/.ssh/argo-git-ops.pub into the Key text box.
    • Click Add SSH Key
  1. In the workshop terminal use the private key to connect to the GitHub repo like this:
    argocd repo add $GITOPS_REPO_URL_ARGOCD --ssh-private-key-path ~/.ssh/argo-git-ops --insecure-ignore-host-key --upsert --name git-repo

  2. Check in the ArgoCD console to make sure it worked

    • Choose Settings
    • Choose Repositories
    • you should see your repo connected.

Continue from the "Initial Setup" step in the tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants