Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
diana esteves committed Sep 23, 2024
1 parent e37e5c7 commit d0f1064
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions aws-ts-oidc-provider-pulumi-cloud/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ const thumbprint = certs.certificates[0].sha1Fingerprint;

function getProviderArn() {
const existingProvider = aws.iam.getOpenIdConnectProviderOutput({
url: oidcIdpUrl
})
url: oidcIdpUrl,
});
if (existingProvider) {
console.log("OIDC Provider already exists ...");
// upsert audience
new command.local.Command("oidc-client-id", {
const cmd = new command.local.Command("oidc-client-id", {
create: pulumi.interpolate`aws iam add-client-id-to-open-id-connect-provider --open-id-connect-provider-arn ${existingProvider.arn} --client-id aws:${audience}`,
delete: pulumi.interpolate`aws iam remove-client-id-from-open-id-connect-provider --open-id-connect-provider-arn ${existingProvider.arn} --client-id aws:${audience}`,
});
Expand All @@ -36,7 +36,7 @@ function getProviderArn() {
thumbprintLists: [thumbprint],
}, {
protect: true,
})
});
return provider.arn;
}
}
Expand All @@ -56,8 +56,8 @@ const policyDocument = arn.apply(arn => aws.iam.getPolicyDocument({
test: "StringEquals",
variable: `api.pulumi.com/oidc:aud`,
values: [`aws:${audience}`], // new format
}]
}]
}],
}],
}));

// // Create a new role that can be assumed by the OIDC provider
Expand All @@ -66,7 +66,7 @@ const role = new aws.iam.Role("role", {
});

// Attach the AWS managed policy "AdministratorAccess" to the role.
new aws.iam.RolePolicyAttachment("policy", {
const rpa = new aws.iam.RolePolicyAttachment("policy", {
policyArn: "arn:aws:iam::aws:policy/AdministratorAccess",
role: role.name,
});
Expand Down Expand Up @@ -95,7 +95,7 @@ const envJson = pulumi.jsonStringify({
const envAsset = envJson.apply(json => new pulumi.asset.StringAsset(json));

// Create a new environment
new pulumiservice.Environment("aws-oidc-admin", {
const env = new pulumiservice.Environment("aws-oidc-admin", {
name: "test",
// project: "auth", // post esc-GA
organization: audience,
Expand Down

0 comments on commit d0f1064

Please sign in to comment.