cloudinit.getConfig
Explore with Pulumi AI
Renders a multipart MIME configuration for use with cloud-init.
Cloud-init is a commonly-used startup configuration utility for cloud compute
instances. It accepts configuration via provider-specific user data mechanisms,
such as user_data
for Amazon EC2 instances. Multipart MIME is one of the
data formats it accepts. For more information, see
User-Data Formats
in the cloud-init manual.
This is not a generalized utility for producing multipart MIME messages. Its featureset is specialized for the features of cloud-init.
Example Usage
using Pulumi;
using CloudInit = Pulumi.CloudInit;
class MyStack : Stack
{
public MyStack()
{
var foo = Output.Create(CloudInit.GetConfig.InvokeAsync(new CloudInit.GetConfigArgs
{
Base64Encode = false,
Gzip = false,
Parts =
{
new CloudInit.Inputs.GetConfigPartArgs
{
Content = "baz",
ContentType = "text/x-shellscript",
Filename = "foobar.sh",
},
},
}));
}
}
package main
import (
"github.com/pulumi/pulumi-cloudinit/sdk/go/cloudinit"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
opt0 := false
opt1 := false
_, err := cloudinit.LookupConfig(ctx, &GetConfigArgs{
Base64Encode: &opt0,
Gzip: &opt1,
Parts: []GetConfigPart{
GetConfigPart{
Content: "baz",
ContentType: "text/x-shellscript",
Filename: "foobar.sh",
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_cloudinit as cloudinit
foo = cloudinit.get_config(base64_encode=False,
gzip=False,
parts=[cloudinit.GetConfigPartArgs(
content="baz",
content_type="text/x-shellscript",
filename="foobar.sh",
)])
import * as pulumi from "@pulumi/pulumi";
import * as cloudinit from "@pulumi/cloudinit";
const foo = pulumi.output(cloudinit.getConfig({
base64Encode: false,
gzip: false,
parts: [{
content: "baz",
contentType: "text/x-shellscript",
filename: "foobar.sh",
}],
}));
Coming soon!
Using getConfig
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getConfig(args: GetConfigArgs, opts?: InvokeOptions): Promise<GetConfigResult>
function getConfigOutput(args: GetConfigOutputArgs, opts?: InvokeOptions): Output<GetConfigResult>
def get_config(base64_encode: Optional[bool] = None,
boundary: Optional[str] = None,
gzip: Optional[bool] = None,
parts: Optional[Sequence[GetConfigPart]] = None,
opts: Optional[InvokeOptions] = None) -> GetConfigResult
def get_config_output(base64_encode: Optional[pulumi.Input[bool]] = None,
boundary: Optional[pulumi.Input[str]] = None,
gzip: Optional[pulumi.Input[bool]] = None,
parts: Optional[pulumi.Input[Sequence[pulumi.Input[GetConfigPartArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetConfigResult]
func LookupConfig(ctx *Context, args *LookupConfigArgs, opts ...InvokeOption) (*LookupConfigResult, error)
func LookupConfigOutput(ctx *Context, args *LookupConfigOutputArgs, opts ...InvokeOption) LookupConfigResultOutput
> Note: This function is named LookupConfig
in the Go SDK.
public static class GetConfig
{
public static Task<GetConfigResult> InvokeAsync(GetConfigArgs args, InvokeOptions? opts = null)
public static Output<GetConfigResult> Invoke(GetConfigInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetConfigResult> getConfig(GetConfigArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: cloudinit:index/getConfig:getConfig
arguments:
# arguments dictionary
The following arguments are supported:
- Parts
List<Pulumi.
Cloud Init. Inputs. Get Config Part> A nested block type which adds a file to the generated cloud-init configuration. Use multiple
part
blocks to specify multiple files, which will be included in order of declaration in the final MIME document.- Base64Encode bool
Base64 encoding of the rendered output. Defaults to
true
, and cannot be disabled ifgzip
istrue
.- Boundary string
Define the Writer's default boundary separator. Defaults to
MIMEBOUNDARY
.- Gzip bool
Specify whether or not to gzip the rendered output. Defaults to
true
.
- Parts
[]Get
Config Part A nested block type which adds a file to the generated cloud-init configuration. Use multiple
part
blocks to specify multiple files, which will be included in order of declaration in the final MIME document.- Base64Encode bool
Base64 encoding of the rendered output. Defaults to
true
, and cannot be disabled ifgzip
istrue
.- Boundary string
Define the Writer's default boundary separator. Defaults to
MIMEBOUNDARY
.- Gzip bool
Specify whether or not to gzip the rendered output. Defaults to
true
.
- parts
List<Get
Config Part> A nested block type which adds a file to the generated cloud-init configuration. Use multiple
part
blocks to specify multiple files, which will be included in order of declaration in the final MIME document.- base64Encode Boolean
Base64 encoding of the rendered output. Defaults to
true
, and cannot be disabled ifgzip
istrue
.- boundary String
Define the Writer's default boundary separator. Defaults to
MIMEBOUNDARY
.- gzip Boolean
Specify whether or not to gzip the rendered output. Defaults to
true
.
- parts
Get
Config Part[] A nested block type which adds a file to the generated cloud-init configuration. Use multiple
part
blocks to specify multiple files, which will be included in order of declaration in the final MIME document.- base64Encode boolean
Base64 encoding of the rendered output. Defaults to
true
, and cannot be disabled ifgzip
istrue
.- boundary string
Define the Writer's default boundary separator. Defaults to
MIMEBOUNDARY
.- gzip boolean
Specify whether or not to gzip the rendered output. Defaults to
true
.
- parts
Sequence[Get
Config Part] A nested block type which adds a file to the generated cloud-init configuration. Use multiple
part
blocks to specify multiple files, which will be included in order of declaration in the final MIME document.- base64_
encode bool Base64 encoding of the rendered output. Defaults to
true
, and cannot be disabled ifgzip
istrue
.- boundary str
Define the Writer's default boundary separator. Defaults to
MIMEBOUNDARY
.- gzip bool
Specify whether or not to gzip the rendered output. Defaults to
true
.
- parts List<Property Map>
A nested block type which adds a file to the generated cloud-init configuration. Use multiple
part
blocks to specify multiple files, which will be included in order of declaration in the final MIME document.- base64Encode Boolean
Base64 encoding of the rendered output. Defaults to
true
, and cannot be disabled ifgzip
istrue
.- boundary String
Define the Writer's default boundary separator. Defaults to
MIMEBOUNDARY
.- gzip Boolean
Specify whether or not to gzip the rendered output. Defaults to
true
.
getConfig Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Parts
List<Pulumi.
Cloud Init. Outputs. Get Config Part> - Rendered string
The final rendered multi-part cloud-init config.
- Base64Encode bool
- Boundary string
- Gzip bool
- Id string
The provider-assigned unique ID for this managed resource.
- Parts
[]Get
Config Part - Rendered string
The final rendered multi-part cloud-init config.
- Base64Encode bool
- Boundary string
- Gzip bool
- id String
The provider-assigned unique ID for this managed resource.
- parts
List<Get
Config Part> - rendered String
The final rendered multi-part cloud-init config.
- base64Encode Boolean
- boundary String
- gzip Boolean
- id string
The provider-assigned unique ID for this managed resource.
- parts
Get
Config Part[] - rendered string
The final rendered multi-part cloud-init config.
- base64Encode boolean
- boundary string
- gzip boolean
- id str
The provider-assigned unique ID for this managed resource.
- parts
Sequence[Get
Config Part] - rendered str
The final rendered multi-part cloud-init config.
- base64_
encode bool - boundary str
- gzip bool
- id String
The provider-assigned unique ID for this managed resource.
- parts List<Property Map>
- rendered String
The final rendered multi-part cloud-init config.
- base64Encode Boolean
- boundary String
- gzip Boolean
Supporting Types
GetConfigPart
- Content string
Body content for the part.
- Content
Type string A MIME-style content type to report in the header for the part.
- Filename string
A filename to report in the header for the part.
- Merge
Type string A value for the
X-Merge-Type
header of the part, to control cloud-init merging behavior.
- Content string
Body content for the part.
- Content
Type string A MIME-style content type to report in the header for the part.
- Filename string
A filename to report in the header for the part.
- Merge
Type string A value for the
X-Merge-Type
header of the part, to control cloud-init merging behavior.
- content String
Body content for the part.
- content
Type String A MIME-style content type to report in the header for the part.
- filename String
A filename to report in the header for the part.
- merge
Type String A value for the
X-Merge-Type
header of the part, to control cloud-init merging behavior.
- content string
Body content for the part.
- content
Type string A MIME-style content type to report in the header for the part.
- filename string
A filename to report in the header for the part.
- merge
Type string A value for the
X-Merge-Type
header of the part, to control cloud-init merging behavior.
- content str
Body content for the part.
- content_
type str A MIME-style content type to report in the header for the part.
- filename str
A filename to report in the header for the part.
- merge_
type str A value for the
X-Merge-Type
header of the part, to control cloud-init merging behavior.
- content String
Body content for the part.
- content
Type String A MIME-style content type to report in the header for the part.
- filename String
A filename to report in the header for the part.
- merge
Type String A value for the
X-Merge-Type
header of the part, to control cloud-init merging behavior.
Package Details
- Repository
- cloud-init pulumi/pulumi-cloudinit
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
cloudinit
Terraform Provider.