Open eduard93 opened 3 years ago
Hi @eduard93, thank you for raising this issue. I gave this a try in the AWS console (using the same image/port number without specifying an authentication configuration ) and realized that the console greys-out "automatic deployments", meaning that the auto_deployments_enabled
needs to be configured to false
in your resource. I believe that's whats causing the creation to fail..Unfortunately, I don't see this documented in the AWS API docs (and I omitted this in the terraform docs as well), but it's something that can definitely be added as it seems specific to using a public ECR image.
Let me know if adding the above configuration (auto_deployments_enabled = false
) works for you!
Here's what I'm seeing after a successful deployment in the aws cli:
{
"Service": {
"ServiceName": "test2",
"ServiceId": "ac472521e814462f84b0dedc0a671f1e",
"ServiceArn": "arn:aws:apprunner:us-east-2:XXXXXXXXX:service/test2/ac472521e814462f84b0dedc0a671f1e",
"ServiceUrl": "cv8mfdmu4j.us-east-2.awsapprunner.com",
"CreatedAt": "2021-06-11T11:37:25-04:00",
"UpdatedAt": "2021-06-11T11:37:25-04:00",
"Status": "RUNNING",
"SourceConfiguration": {
"ImageRepository": {
"ImageIdentifier": "public.ecr.aws/nginx/nginx:latest",
"ImageConfiguration": {
"Port": "80"
},
"ImageRepositoryType": "ECR_PUBLIC"
},
"AutoDeploymentsEnabled": false
},
"InstanceConfiguration": {
"Cpu": "1024",
"Memory": "2048"
},
"HealthCheckConfiguration": {
"Protocol": "TCP",
"Path": "/",
"Interval": 10,
"Timeout": 5,
"HealthyThreshold": 1,
"UnhealthyThreshold": 5
},
"AutoScalingConfigurationSummary": {
"AutoScalingConfigurationArn": "arn:aws:apprunner:us-east-2:XXXXXXXXX:autoscalingconfiguration/DefaultConfiguration/1/00000000000000000000000000000001",
"AutoScalingConfigurationName": "DefaultConfiguration",
"AutoScalingConfigurationRevision": 1
}
}
}
@anGie44 adding auto_deployments_enabled = false
worked for me! Thank you!
Adding docs that auto_deployments_enabled = false
property must be specified for public images would be nice.
I'm also now able to report original issue I wanted to report: https://github.com/hashicorp/terraform-provider-aws/issues/19776
Awesome, we'll use this issue then to track that documentation change š
It would be also nice to fix last error: %!s(<nil>)
part š
I have a similar problem with private image and I have no idea what is wrong yet š
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Alternatively, I have also tried to provide
authentication_configuration
(note that<account>
is edited due to the security considerations):With
AppRunnerECRAccessRole
giving a full ECR access:Debug Output
Expected Behavior
AppRunner Service is created.
Actual Behavior
AppRunner Service is NOT created. I'm getting this error:
Deploy logs in CloudWatch:
Steps to Reproduce
terraform apply
Important Factoids
public.ecr.aws/nginx/nginx:latest
instead ofpublic.ecr.aws/jg/hello:latest
becausepublic.ecr.aws/jg/hello:latest
does not exist.authentication_configuration
.public.ecr.aws/nginx/nginx:latest
image from AWS Console also works.References