This message was deleted.
# general
s
This message was deleted.
b
Can you share a bit mroe about what you are having trouble with?
t
Hi @bored-table-20691 Thanks for the message , I am looking for different properties of spacific s3 bucket bening created our pulumi code . for example BucketDomainName, Id, Region etc. I am using the following code create s3 bucket using automation api. In this example i am using
siteBucket
variable to get s3 resources properties in the form of string i am having trouble converting the values into string . Is there any thing i am missing.
Copy code
func createPulumiProgram(content string, bname string) pulumi.RunFunc {
	return func(ctx *pulumi.Context) error {
		// our program defines a s3 website.
		// here we create the bucket
		siteBucket, err := s3.NewBucket(ctx, bname, &s3.BucketArgs{
			Website: s3.BucketWebsiteArgs{
				IndexDocument: pulumi.String("index.html"),
			},
		})
		if err != nil {
			return err
		}
		Region := siteBucket.Region
		BucketDomainName := siteBucket.BucketDomainName
		Bucket := siteBucket.Bucket 
		}
I would like to store the following infromation in DB and that why i am trying to convert the value to string however
sitebucket
returns pulumi.string format which i can not store in DB.
Copy code
"outputs": {
                        "accelerationStatus": "",
                        "acl": "private",
                        "arn": "arn:aws:s3:::s3-website-bucket-7a7e85d",
                        "bucket": "s3-website-bucket-7a7e85d",
                        "bucketDomainName": "<http://s3-website-bucket-7a7e85d.s3.amazonaws.com|s3-website-bucket-7a7e85d.s3.amazonaws.com>",
                        "bucketRegionalDomainName": "<http://s3-website-bucket-7a7e85d.s3.us-east-2.amazonaws.com|s3-website-bucket-7a7e85d.s3.us-east-2.amazonaws.com>",
                        "corsRules": [],
                        "forceDestroy": false,
                        "grants": [],
                        "hostedZoneId": "Z2O1EMRO9K5GLX",
                        "id": "s3-website-bucket-7a7e85d",
                        "lifecycleRules": [],
                        "loggings": [],
                        "objectLockConfiguration": null,
                        "region": "us-east-2",
                        "replicationConfiguration": null,
                        "requestPayer": "BucketOwner",
                        "serverSideEncryptionConfiguration": null,
                        "tags": {},
                        "versioning": {
                            "enabled": false,
                            "mfaDelete": false
                        },
b
Right - you would typically export the values you wanted, and then in your automation program, you would reference the outputs after the stack was created and then store that in the DB. Note that the “store in DB” part is not part of your Pulumi stack - it only references the outputs of the Pulumi stack.
t
Hi @bored-table-20691 Thanks for rely , i will try as you suggested export the values.