Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
baoduy committed Jun 22, 2024
1 parent 19de358 commit 67239e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
24 changes: 11 additions & 13 deletions src/VNet/PrivateDns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const addARecord = ({
};

interface VnetToPrivateDnsProps extends BasicResourceArgs {
zoneName: string;
zoneName: Input<string>;
vnetId: Input<string>;
registrationEnabled?: boolean;
}
Expand All @@ -59,7 +59,7 @@ export const linkVnetToPrivateDns = ({
...others
}: VnetToPrivateDnsProps) => {
return new native.network.VirtualNetworkLink(
`${name}-${zoneName}-link`,
`${name}-link`,
{
...group,
location: "global",
Expand Down Expand Up @@ -104,17 +104,15 @@ export default ({
const toDnsInfo = () => ({ resourceName: name, group, id: zone.id });

if (vnetIds) {
all(vnetIds).apply((vn) =>
vn.map((id) =>
linkVnetToPrivateDns({
name,
vnetId: id,
zoneName: name,
group,
registrationEnabled: false,
dependsOn: zone,
}),
),
vnetIds.map((id) =>
linkVnetToPrivateDns({
name,
vnetId: id,
zoneName: name,
group,
registrationEnabled: false,
dependsOn: zone,
}),
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/VNet/PrivateEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default ({

//Create Zone
const zone = PrivateZone({
name: `${resourceInfo?.name}.${privateDnsZoneName}`,
name: `${resourceInfo!.name}.${privateDnsZoneName}`,
group,
});

Expand All @@ -69,7 +69,7 @@ export default ({
const vnetId = getVnetIdFromSubnetId(id);
linkVnetToPrivateDns({
name: `${name}-${index}`,
zoneName: privateDnsZoneName,
zoneName: zone.name,
vnetId,
group,
dependsOn: zone.resource,
Expand Down

0 comments on commit 67239e7

Please sign in to comment.