"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.OpenIdConnectProvider=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),path=require("path"),core_1=require("../../core"),RESOURCE_TYPE="Custom::AWSCDKOpenIdConnectProvider";class OpenIdConnectProvider extends core_1.Resource{constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings.aws_cdk_lib_aws_iam_OpenIdConnectProviderProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,OpenIdConnectProvider),error}const resource=new core_1.CustomResource(this,"Resource",{resourceType:RESOURCE_TYPE,serviceToken:this.getOrCreateProvider(),properties:{ClientIDList:props.clientIds,ThumbprintList:props.thumbprints,Url:props.url}});this.openIdConnectProviderArn=core_1.Token.asString(resource.ref),this.openIdConnectProviderIssuer=core_1.Arn.extractResourceName(this.openIdConnectProviderArn,"oidc-provider")}static fromOpenIdConnectProviderArn(scope,id,openIdConnectProviderArn){const resourceName=core_1.Arn.extractResourceName(openIdConnectProviderArn,"oidc-provider");class Import extends core_1.Resource{constructor(){super(...arguments),this.openIdConnectProviderArn=openIdConnectProviderArn,this.openIdConnectProviderIssuer=resourceName}}return new Import(scope,id)}getOrCreateProvider(){return core_1.CustomResourceProvider.getOrCreate(this,RESOURCE_TYPE,{codeDirectory:path.join(__dirname,"oidc-provider"),runtime:core_1.CustomResourceProviderRuntime.NODEJS_14_X,policyStatements:[{Effect:"Allow",Resource:"*",Action:["iam:CreateOpenIDConnectProvider","iam:DeleteOpenIDConnectProvider","iam:UpdateOpenIDConnectProviderThumbprint","iam:AddClientIDToOpenIDConnectProvider","iam:RemoveClientIDFromOpenIDConnectProvider"]}]})}}exports.OpenIdConnectProvider=OpenIdConnectProvider,_a=JSII_RTTI_SYMBOL_1,OpenIdConnectProvider[_a]={fqn:"aws-cdk-lib.aws_iam.OpenIdConnectProvider",version:"2.29.0"};
//# sourceMappingURL=oidc-provider.js.map
