{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PassAWSPartnerCentralRole",
      "Effect": "Allow",
      "Action": [
        "iam:PassRole"
      ],
      "Resource": "arn:aws:iam::*:role/PartnerCentralRoleFor*",
      "Condition": {
        "StringEquals": {
          "iam:PassedToService": "partnercentral-account-management.amazonaws.com"
        }
      }
    },
    {
      "Sid": "PartnerUserRoleAssociation",
      "Effect": "Allow",
      "Action": [
        "iam:ListRoles",
        "Partnercentral-account-management:AssociatePartnerUser",
        "Partnercentral-account-management:DisassociatePartnerUser"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AWSPartnerCentralAccess",
      "Effect": "Allow",
      "Action": [
        "partnercentral:*"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "partnercentral:Catalog": [
            "AWS",
            "Sandbox"
          ]
        }
      }
    },
    {
      "Sid": "VerificationAccess",
      "Effect": "Allow",
      "Action": [
        "partnercentral:StartVerification",
        "partnercentral:GetVerification"
      ],
      "Resource": "*"
    },
    {
      "Sid": "PassAWSPartnerCentralSnapshotJobRole",
      "Effect": "Allow",
      "Action": [
        "iam:PassRole"
      ],
      "Resource": [
        "arn:aws:iam::*:role/*"
      ],
      "Condition": {
        "StringEquals": {
          "iam:PassedToService": "resource-snapshot-job.partnercentral-selling.amazonaws.com"
        }
      }
    },
    {
      "Sid": "LegacyPartnerCentralAccess",
      "Effect": "Allow",
      "Action": [
        "partnercentral-account-management:AccessLegacyPartnerCentral"
      ],
      "Resource": "*"
    },
    {
      "Sid": "PartnerCentralMarketingAccess",
      "Effect": "Allow",
      "Action": [
        "partnercentral-account-management:AccessMarketingCentral"
      ],
      "Resource": "*"
    },
    {
      "Sid": "ChannelBillingTransferRoleAccess",
      "Effect": "Allow",
      "Action": [
        "sts:AssumeRole"
      ],
      "Resource": [
        "arn:aws:iam::*:role/PartnerCentralChannelBillingTransferManagement",
        "arn:aws:iam::*:role/PartnerCentralChannelBillingTransferReadOnly"
      ]
    },
    {
      "Sid": "PartnerCentralEphemeralWriteS3Access",
      "Effect": "Allow",
      "Action": [
        "s3:PutObject"
      ],
      "Resource": "arn:aws:s3:::aws-partner-central-marketplace-ephemeral-writeonly-files/${aws:PrincipalAccount}/*"
    },
    {
      "Sid": "SupportAccess",
      "Effect": "Allow",
      "Action": [
        "support:CreateCase",
        "support:DescribeCases",
        "support:AddCommunicationToCase",
        "support:ResolveCase",
        "support:AddAttachmentsToSet",
        "support:DescribeCommunications"
      ],
      "Resource": "*"
    },
    {
      "Sid": "ListEntitiesAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:ListEntities"
      ],
      "Resource": "*"
    },
    {
      "Sid": "DescribeEntityAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:DescribeEntity"
      ],
      "Resource": [
        "arn:aws:aws-marketplace:*:*:AWSMarketplace*/Solution/*",
        "arn:aws:aws-marketplace:*:*:AWSMarketplace*/OfferSet/*",
        "arn:aws:aws-marketplace:*:*:AWSMarketplace*/Offer/*",
        "arn:aws:aws-marketplace:*:*:AWSMarketplace*/CaseStudy/*"
      ]
    },
    {
      "Sid": "AWSMarketplaceAgreementsReadAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:SearchAgreements",
        "aws-marketplace:DescribeAgreement"
      ],
      "Resource": "*",
      "Condition": {
        "ForAllValues:StringEquals": {
          "aws-marketplace:AgreementType": [
            "PurchaseAgreement"
          ]
        }
      }
    },
    {
      "Sid": "AmazonQPartnerAssistantAccess",
      "Effect": "Allow",
      "Action": [
        "q:StartConversation",
        "q:SendMessage",
        "q:GetConversation",
        "q:ListConversations",
        "q:PassRequest"
      ],
      "Resource": "*"
    },
    {
      "Sid": "PartnerCentralAgentsSessionAccess",
      "Effect": "Allow",
      "Action": [
        "partnercentral:UseSession"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "partnercentral:Catalog": [
            "AWS",
            "Sandbox"
          ]
        },
        "Bool": {
          "aws:IsMcpServiceAction": "true"
        }
      }
    },
    {
      "Sid": "CaseStudyStartChangeSet",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:StartChangeSet"
      ],
      "Resource": [
        "arn:aws:aws-marketplace:*:*:AWSMarketplace*/CaseStudy/*",
        "arn:aws:aws-marketplace:*:*:AWSMarketplace*/ChangeSet/*"
      ],
      "Condition": {
        "StringEquals": {
          "catalog:ChangeType": [
            "CreateCaseStudy",
            "UpdateInformation",
            "ReleaseCaseStudy",
            "RestrictCaseStudy",
            "UpdateVisibility"
          ]
        }
      }
    },
    {
      "Sid": "CaseStudyDescribeChangeSet",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:DescribeChangeSet"
      ],
      "Resource": "arn:aws:aws-marketplace:*:*:AWSMarketplace*/ChangeSet/*"
    },
    {
      "Sid": "CaseStudyListChangeSets",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:ListChangeSets"
      ],
      "Resource": "*"
    },
    {
      "Sid": "CaseStudyEntityTagAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:ListTagsForResource",
        "aws-marketplace:TagResource",
        "aws-marketplace:UntagResource"
      ],
      "Resource": "arn:aws:aws-marketplace:*:*:AWSMarketplace*/CaseStudy/*"
    },
    {
      "Sid": "IAMGetRole",
      "Effect": "Allow",
      "Action": [
        "iam:GetRole"
      ],
      "Resource": "arn:aws:iam::*:role/aws-service-role/partnercentral-account.amazonaws.com/AWSServiceRoleForPartnerCentralAccount"
    },
    {
      "Sid": "CreateServiceLinkedRole",
      "Effect": "Allow",
      "Action": "iam:CreateServiceLinkedRole",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "iam:AWSServiceName": "partnercentral-account.amazonaws.com"
        }
      }
    },
    {
      "Sid": "SellerReportingDataAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:GetSellerReportingData"
      ],
      "Resource": [
        "arn:aws:aws-marketplace::*:AWSMarketplace/ReportingData/BillingEvent_V1/Dataset/BilledRevenue_V1",
        "arn:aws:aws-marketplace::*:AWSMarketplace/ReportingData/Solution_V1/Dataset/Solution_V1",
        "arn:aws:aws-marketplace::*:AWSMarketplace/ReportingData/Marketing_V1/Dataset/CaseStudy_V1"
      ]
    }
  ]
}
