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

aws_apprunner_service instance_configuration.instance_role_arn is required #20145

Closed
evantbyrne opened this issue Jul 12, 2021 · 4 comments · Fixed by #21842
Closed

aws_apprunner_service instance_configuration.instance_role_arn is required #20145

evantbyrne opened this issue Jul 12, 2021 · 4 comments · Fixed by #21842
Labels
documentation Introduces or discusses updates to documentation. service/apprunner Issues and PRs that pertain to the apprunner service.
Milestone

Comments

@evantbyrne
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v1.0.2
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.49.0

Affected Resource(s)

  • aws_apprunner_service

Terraform Configuration Files

resource "aws_apprunner_auto_scaling_configuration_version" "scratch" {
  auto_scaling_configuration_name = "scratch"
  min_size = 1
  max_size = 1
}

resource "aws_apprunner_service" "scratch" {
  auto_scaling_configuration_arn = aws_apprunner_auto_scaling_configuration_version.scratch.arn

  instance_configuration {
    cpu = 1024
    memory = 2048
  }

  service_name = "scratch"

  source_configuration {
    authentication_configuration {
      access_role_arn = "arn:aws:iam::[REDACTED]:role/service-role/AppRunnerECRAccessRole"
    }
    auto_deployments_enabled = false
    image_repository {
      image_configuration {
        port = "8080"
        start_command = "[REDACTED]"
      }
      image_identifier = "[REDAACTED].dkr.ecr.us-east-1.amazonaws.com/[REDACTED]:latest"
      image_repository_type = "ECR"
    }
  }
}

Debug Output

Creating terraform_terraform_run ... done
╷
│ Error: Missing required argument
│
│   on main.tf line 16, in resource "aws_apprunner_service" "scratch":
│   16:   instance_configuration {
│
│ The argument "instance_role_arn" is required, but no definition was found.
╵
ERROR: 1

Expected Behavior

Expected to create App Runner service, because the InstanceConfiguration documentation indicates that InstanceRoleArn is optional.

As an aside question: If I were to create a role for this, what would that look like? I'm having difficulty finding documentation on what a minimal role for this looks like.

Actual Behavior

App Runner service is not created, because instance_configuration.instance_role_arn is marked as required. Additionally, if I remove instance_configuration entirely then Terraform succeeds in creating the service.

Steps to Reproduce

  1. terraform apply

Thanks,
–Evan

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/apprunner Issues and PRs that pertain to the apprunner service. labels Jul 12, 2021
@anGie44 anGie44 added documentation Introduces or discusses updates to documentation. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 12, 2021
@gdavison
Copy link
Contributor

AWS has some documentation on the instance role at https://docs.aws.amazon.com/apprunner/latest/dg/security_iam_service-with-iam.html#security_iam_service-with-iam-roles. The permissions needed will basically depend on what your application does.

@ludofischer
Copy link

AWS has some documentation on the instance role at https://docs.aws.amazon.com/apprunner/latest/dg/security_iam_service-with-iam.html#security_iam_service-with-iam-roles. The permissions needed will basically depend on what your application does.

From reading that documentation, it does seem to me that the instance role is optional. Under the Instance Role heading it says

The instance role is an optional role that App Runner uses to provide permissions to AWS service actions

@github-actions
Copy link

github-actions bot commented Dec 1, 2021

This functionality has been released in v3.67.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/apprunner Issues and PRs that pertain to the apprunner service.
Projects
None yet
4 participants