{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "MarketplaceListAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:ListChangeSets",
        "aws-marketplace:ListEntities",
        "aws-marketplace:ListAssessments"
      ],
      "Resource": "*"
    },
    {
      "Sid": "MarketplaceResourceAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:DescribeChangeSet",
        "aws-marketplace:StartChangeSet",
        "aws-marketplace:CancelChangeSet",
        "aws-marketplace:DescribeEntity"
      ],
      "Resource": "arn:aws:aws-marketplace:*:*:AWSMarketplace*/*"
    },
    {
      "Sid": "MarketplaceAssessmentAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:DescribeAssessment"
      ],
      "Resource": "*"
    },
    {
      "Sid": "EC2ResourceAccess",
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeImages",
        "ec2:DescribeSnapshots",
        "ec2:ModifyImageAttribute",
        "ec2:ModifySnapshotAttribute"
      ],
      "Resource": "*"
    },
    {
      "Sid": "GetIAMRoleAccess",
      "Effect": "Allow",
      "Action": [
        "iam:GetRole"
      ],
      "Resource": "arn:aws:iam::*:role/*"
    },
    {
      "Sid": "IAMPassRoleAccess",
      "Effect": "Allow",
      "Action": [
        "iam:PassRole"
      ],
      "Resource": "arn:aws:iam::*:role/*",
      "Condition": {
        "StringEquals": {
          "iam:PassedToService": "assets.marketplace.amazonaws.com"
        }
      }
    },
    {
      "Sid": "VendorInsightsAccess",
      "Effect": "Allow",
      "Action": [
        "vendor-insights:GetDataSource",
        "vendor-insights:ListDataSources",
        "vendor-insights:ListSecurityProfiles",
        "vendor-insights:GetSecurityProfile",
        "vendor-insights:GetSecurityProfileSnapshot",
        "vendor-insights:ListSecurityProfileSnapshots"
      ],
      "Resource": "*"
    },
    {
      "Sid": "TagAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:TagResource",
        "aws-marketplace:UntagResource",
        "aws-marketplace:ListTagsForResource"
      ],
      "Resource": "arn:aws:aws-marketplace:*:*:AWSMarketplace*/*"
    },
    {
      "Sid": "ResourceSharingAccess",
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:GetResourcePolicy",
        "aws-marketplace:PutResourcePolicy",
        "aws-marketplace:DeleteResourcePolicy"
      ],
      "Resource": "arn:aws:aws-marketplace:*:*:AWSMarketplace*/*"
    },
    {
      "Sid": "MarketplaceEphemeralWriteS3Access",
      "Effect": "Allow",
      "Action": [
        "s3:PutObject"
      ],
      "Resource": [
        "arn:aws:s3:::aws-partner-central-marketplace-ephemeral-writeonly-files/${aws:PrincipalAccount}/*"
      ]
    },
    {
      "Sid": "LegacyPartnerCentralAccess",
      "Effect": "Allow",
      "Action": [
        "partnercentral-account-management:AccessLegacyPartnerCentral"
      ],
      "Resource": "*",
      "Condition": {
        "ForAnyValue:StringEquals": {
          "partnercentral-account-management:LegacyPartnerCentralRole": "TechnicalStaff"
        }
      }
    },
    {
      "Sid": "AmazonQPartnerAssistantAccess",
      "Effect": "Allow",
      "Action": [
        "q:StartConversation",
        "q:SendMessage",
        "q:GetConversation",
        "q:ListConversations",
        "q:PassRequest"
      ],
      "Resource": "*"
    },
    {
      "Sid": "ListAccountConnections",
      "Effect": "Allow",
      "Action": [
        "partnercentral:ListConnections"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "partnercentral:Catalog": [
            "AWS",
            "Sandbox"
          ]
        }
      }
    },
    {
      "Sid": "ReadAccountConnections",
      "Effect": "Allow",
      "Action": [
        "partnercentral:GetConnection"
      ],
      "Resource": "arn:aws:partnercentral:*::catalog/*/connection/*",
      "Condition": {
        "StringEquals": {
          "partnercentral:Catalog": [
            "AWS",
            "Sandbox"
          ]
        }
      }
    }
  ]
}
