Hey guys! Quick question - What’s the difference b...
# contribute
w
Hey guys! Quick question - What’s the difference between a resource and a data source? I’m thinking specifically in the pulumi-tf-provider-boilerplate project, in
provider/resources.go
Copy code
Resources:            map[string]*tfbridge.ResourceInfo{
			// Map each resource in the Terraform provider to a Pulumi type. Two examples
			// are below - the single line form is the common case. The multi-line form is
			// needed only if you wish to override types or other default options.
			//
			// "aws_iam_role": {Tok: makeResource(mainMod, "IamRole")}
			//
			// "aws_acm_certificate": {
			// 	Tok: makeResource(mainMod, "Certificate"),
			// 	Fields: map[string]*tfbridge.SchemaInfo{
			// 		"tags": {Type: makeType(mainPkg, "Tags")},
			// 	},
			// },
		},
		DataSources: map[string]*tfbridge.DataSourceInfo{
			// Map each resource in the Terraform provider to a Pulumi function. An example
			// is below.
			// "aws_ami": {Tok: makeDataSource(mainMod, "getAmi")},
		},
t
Data source is the Terraform’s term for a way to retrieve information about an existing resource from a cloud while resources create new resources
w
Awesome, thank you!