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

Cannot prompt for [Select the plugin module to execute] when '--yes' flag is set #14057

Open
2 tasks done
kasukur opened this issue Jan 6, 2025 · 1 comment
Open
2 tasks done
Labels
headless Headless mode for CI/CD pending-response Issue is pending response from the issue author pending-triage Issue is pending triage

Comments

@kasukur
Copy link

kasukur commented Jan 6, 2025

How did you install the Amplify CLI?

npm install -g @aws-amplify/cli

If applicable, what version of Node.js are you using?

v20.11.1

Amplify CLI Version

12.14.0

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

Describe the bug

  1. created a react app with just front-end
  2. deploy the app using
    echo "🏗️ Initializing Amplify project..."
    amplify init \
        --name movies-frontend \
        --envName dev \
        --defaultEditor Visual\ Studio\ Code \
        --yes

Expected behavior

successful deployment

Reproduction steps

  1. create a front-end react app movies-frontend
  2. deploy using
#!/bin/bash

# Exit on error
set -e

echo "🚀 Starting deployment to AWS Amplify..."

# Check if Amplify CLI is installed
if ! command -v amplify &> /dev/null; then
    echo "📦 Installing Amplify CLI..."
    npm install -g @aws-amplify/cli
fi

# Check if we're in the project root directory
if [ ! -f "package.json" ]; then
    echo "❌ package.json not found. Make sure you're in the project root directory."
    exit 1
fi

# Build the React app
echo "📦 Building React application..."
npm install
npm run build

# Verify build directory exists
if [ ! -d "build" ]; then
    echo "❌ Build directory not found. Build may have failed."
    exit 1
fi

# Initialize Amplify if not already initialized
if [ ! -d "amplify" ]; then
    echo "🏗️ Initializing Amplify project..."
    amplify init \
        --name movies-frontend \
        --envName dev \
        --defaultEditor Visual\ Studio\ Code \
        --yes
fi

# Add hosting if not configured
if ! grep -q '"hosting"' amplify/backend/backend-config.json 2>/dev/null; then
    echo "🌐 Adding hosting configuration..."
    # Add hosting with specific configuration
    amplify add hosting \
        --service S3AndCloudFront \
        --providerPlugin awscloudformation \
        --resourceName hostingS3AndCloudFront \
        --yes
fi

# Deploy using Amplify CLI
echo "🚀 Publishing to Amplify..."
amplify publish --yes

echo "✅ Deployment completed!"
echo "Visit the Amplify Console to view your application:"
amplify status

Project Identifier

68d02c090922109f55ca094674edc257

Log output

# Put your logs below this line
/var/folders/2k/p4ht84015493y_nh5l_kqjhh0000gn/T/moviesfrontend/report-1736161067851.zip

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@kasukur kasukur added the pending-triage Issue is pending triage label Jan 6, 2025
@ykethan
Copy link
Member

ykethan commented Jan 7, 2025

Hey @kasukur, thank you for reaching out. You will need to configure the providers on the command.

For example, using the following i was able to create a new project.

AWSCLOUDFORMATIONCONFIG="{\"configLevel\":\"project\",\"useProfile\":true,\"profileName\":\"admin\"}"
PROVIDERS="{\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG}"

echo "🏗️ Initializing Amplify project..."
amplify init \
    --amplify "{\"projectName\":\"movies-frontend\",\"envName\":\"dev\",\"defaultEditor\":\"Visual Studio Code\"}" \
    --providers "$PROVIDERS" \
    --yes

refer to the following documentation providing additional information: https://docs.amplify.aws/gen1/react/tools/cli/usage/headless/

@ykethan ykethan added pending-response Issue is pending response from the issue author headless Headless mode for CI/CD labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
headless Headless mode for CI/CD pending-response Issue is pending response from the issue author pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants