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

ConflictException: PermissionSet with name AdministratorAccess already exists #6

Open
jimsmith opened this issue Apr 18, 2022 · 1 comment
Assignees

Comments

@jimsmith
Copy link

jimsmith commented Apr 18, 2022

Hello,

After running this for the first time it creates the resources as expected.

I now create an AWS member account via aws organizations, I would have expected to be able to re-use existing SSO permission set AdministratorAccess as per AWS documentation: https://docs.aws.amazon.com/singlesignon/latest/userguide/permissionsets.html?icmpid=docs_sso_console

When permission_sets is removed then the module fails as I can see it's required

Terraform v1.1.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v4.10.0
│ Error: error creating SSO Permission Set (AdministratorAccess): ConflictException: PermissionSet with name AdministratorAccess already exists.
│ 
│   with module.sso_devtest1.aws_ssoadmin_permission_set.this["AdministratorAccess"],
│   on .terraform/modules/sso_devtest1/main.tf line 45, in resource "aws_ssoadmin_permission_set" "this":
│   45: resource "aws_ssoadmin_permission_set" "this" {
module "sso_devtest1" {
  source = "git::https://github.com/avlcloudtechnologies/terraform-aws-sso//?ref=v0.1.4"

  permission_sets = {
    AdministratorAccess = {
      description      = "Provides full access to AWS services and resources.",
      session_duration = "PT2H",
      managed_policies = ["arn:aws:iam::aws:policy/AdministratorAccess"]
    },
  }
  account_assignments = [
    {
      principal_name = "DevOps"
      principal_type = "GROUP"
      permission_set = "AdministratorAccess"
      account_ids    = ["${aws_organizations_account.devtest1.id}"]
    },
    {
      principal_name = "Administrators"
      principal_type = "GROUP"
      permission_set = "AdministratorAccess"
      account_ids    = ["${aws_organizations_account.devtest1.id}"]
    },
  ]
}
@aurimasmick aurimasmick self-assigned this Sep 24, 2022
@aurimasmick
Copy link
Contributor

hi @jimsmith, apologies for late reply. I'm not sure I fully understand the issue. The ConflictException error could be caused by existing AdministratorAccess permission set, but in your example it should not be an issue. Would you be able to elaborate on the steps how to reproduce the issue? Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants