-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tls: Create separate pkg to create keypair
It is going to used for all the provider so better to extract it and have different subpackage.
- Loading branch information
1 parent
4ae0bc0
commit 55e98ce
Showing
3 changed files
with
24 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package tls | ||
|
||
import ( | ||
"github.com/pulumi/pulumi-tls/sdk/v4/go/tls" | ||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
) | ||
|
||
func CreateKey(ctx *pulumi.Context) (*tls.PrivateKey, error) { | ||
pk, err := tls.NewPrivateKey( | ||
ctx, | ||
"OpenshiftLocal-OCP", | ||
&tls.PrivateKeyArgs{ | ||
Algorithm: pulumi.String("RSA"), | ||
RsaBits: pulumi.Int(4096), | ||
}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return pk, nil | ||
} |