awslabs / amazon-app-runner-deploy

Registers an AWS AppRunner Service and deploys the application using the source code of a given GitHub repository. Supports both source code and Docker image based service
MIT No Attribution
51 stars 33 forks source link

Error: ConfigurationSource cannot be changed from REPOSITORY to API for CREATE_FAILED services. #47

Open daniel-fulgido opened 1 year ago

daniel-fulgido commented 1 year ago

My pipeline is this:

` name: Deploy to App Runner on: push: branches: [main]

jobs:
deploy: name: Deploy runs-on: ubuntu-latest

steps:
- name: Checkout
  uses: actions/checkout@v3

- name: Configure AWS credentials
  uses: aws-actions/configure-aws-credentials@v1
  with:
    aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
    aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    aws-region: ${{ secrets.AWS_REGION }}

- name: Deploy to App Runner
  id: deploy-apprunner
  uses: awslabs/amazon-app-runner-deploy@main
  env:
    SERVER_PORT: 80
    SECRET_ENV: secret_env
  with:
    service: DEVOPS-NA-INFRA
    source-connection-arn: ${{ secrets.AWS_CONNECTION_SOURCE_ARN }}
    repo: https://github.com/${{ github.repository }}
    branch: ${{ github.ref }}
    runtime: NODEJS_16
    build-command: npm install
    start-command: npm start
    port: 80
    region: ${{ secrets.AWS_REGION }}
    cpu : 1
    memory : 2
    copy-env-vars: |
      SERVER_PORT
    copy-secret-env-vars: |
      SECRET_ENV

- name: App Runner URL
  run: echo "App runner URL ${{ steps.deploy-apprunner.outputs.service-url }}" `

I used this blog post as an example: https://aws.amazon.com/pt/blogs/containers/deploy-applications-in-aws-app-runner-with-github-actions/ and it's not working. My service user has maximum permission to deploy to App Runner

hariohmprasath commented 1 year ago

Hi @daniel-fulgido, Thanks for reaching out. A few followup questions:

  1. Are you updating an existing service? or creating a new service with the name DEVOPS-NA-INFRA?
  2. Is the creation/update failing with just this github repo? Did you try with any other github repositories?
valcarcexyz commented 6 months ago

As a notice, in my case was due to having set the AppRunner instance to configuration through the apprunner.yml, whereas to work with the API, it must be to set up for the be configured through the console or the API